note 50686 added to function.preg-replace
| From: | php-general at lists dot php dot net | Date: | Mon, 07 Mar 2005 12:58:28 +0000 |
| Subject: | note 50686 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86037@lists.php.net to get a copy of this message | ||
Here you have very usefull script to convert links to robots friendly, and read parameters in your
page. I tested this in the site http://www.proanglo.com
You can use links in you page in such form:
http://www.example.com/file.php/s1=1/s2=2/s3=3
OR
http://www.example.com/file.php/s1=1,s2=2,s3=3
Your script:
<?php
$adres = $_SERVER["PATH_INFO"];
$res = preg_replace('@(\w+)=(\w+)@e', '$\\1="\\2";', $adres);
var_dump($s1, $s2, $s3);
?>
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50686
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50686&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50686&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50686&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50686&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50686&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50686&report=yes
Search -- http://master.php.net/manage/user-notes.php