【问题标题】:Replace space between two words with a -用 - 替换两个单词之间的空格
【发布时间】:2019-06-06 13:32:42
【问题描述】:

我有一个包含两个单词的变量

<?php echo htmlencode($record['countrythingy']) ?>

如何将特定变量中的空格替换为 -

干杯

【问题讨论】:

标签: php


【解决方案1】:
$record['countrythingy'] = str_replace(' ', '-', $record['countrythingy']);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-30
    • 2013-07-09
    相关资源
    最近更新 更多