Jump to content

preg_replace for url links


balkan7

Recommended Posts

If i use this code then show: gallery?show=5

if i remove  $html = str_replace('gallery.php','gallery',$html); then show me gallery/5

How can fix it ?

$html = str_replace('gallery.php','gallery',$html);
$html = preg_replace('/gallery\.php\?show=([0-9]+)/i','gallery/$1',$html);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.