如何从php中的url中删除空格和+符号

时间:2015-10-12 07:28:26

标签: php regex

我通过网址发送数组。我的问题是我需要从数组中删除所有空格和加号。

我的网址:$phnno = preg_replace('/\s+/', '', $_REQUEST['phnno']); $phn = (explode(",",$phnno1));

我已经这样做了:

+

现在它删除了所有空格。我也需要删除declare @id int select @id = 1 merge table1 as dest using (values (@id, 'name1')) as source (id, name) on dest.id = @id when matched then update set name = source.name when not matched then insert ( id, name) values ( source.id, source.name); select * from table1 标志。

1 个答案:

答案 0 :(得分:4)

使用以下可能对您有帮助的代码,

$url  = "http://check.php?phnno=+123 35,+321 425,+9898 9898";
$url  =  str_replace("+","",$url);
echo $url;
相关问题