0
我有一个$object
从json对象读取。我正在使用_filter_url()
函数在drupal中将文本显示为url。删除从json输出分号
每当有超过1个网址时,它会在第1个网址的末尾显示分号。我如何删除它?这意味着我需要这些网址以及其下面没有超链接的分号。
function test($object){
echo str_replace('; ','',$object); //this removes the ; but I need the semicolon also to be displayed without any hyperlink below it.
}
function test($object) {
$x = explode(';',$object);
for($i=0;$i<count($x);$i++) {
echo _filter_url($x[$i]); //even this removes the semicolon, but i want the semicolon to be displayed at the middle of multiple urls, however the semicolon should not have the hyperlink under
}
}
thatI得到的输出是:
URL1 URL2每个URL是在单独的线
所需的输出是:
URL1;
URL2
我需要多个网址之间的分号。 但是这个分号不应该是超链接的一部分
在您的示例代码和描述中使用$对象使得这更难理解(因为它看起来像一个字符串)。你应该向我们展示预期的输入,错误的输出以及你实际想要的结果。 – mario 2011-02-24 22:28:30