PHP: Rawurlencode inside Preg-replace

Posted by elmaso on Stack Overflow See other posts from Stack Overflow or by elmaso
Published on 2010-04-05T18:05:02Z Indexed on 2010/04/05 18:23 UTC
Read the original article Hit count: 597

Filed under:
|

Hello, I have this snippet

while($row = mysql_fetch_array($result)){
$search = '' . $row['searchquery'];  
echo '<a href="http://www.example.com/' . preg_replace( array('/[^\s\w]/','/\s/'),array('','+'),$search) . '+/">' ...

but if someone types in äöü, it doesnt show the letters - with rawurlencode thats possible, but I want to remove the blank spaces with pregreplace and replace it with +

is that possible?

© Stack Overflow or respective owner

Related posts about php

Related posts about preg-replace