note 29977 added to function.escapeshellarg
| From: | php at rack1 dot php dot net | Date: | Mon, 03 Mar 2003 05:27:36 +0000 |
| Subject: | note 29977 added to function.escapeshellarg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44758@lists.php.net to get a copy of this message | ||
function duh($a) { return ("\\" . $a); }
$foo = "this (is/a) messed-up path";
$text = preg_replace(
array(
"#(\()#e",
"#(\))#e",
"#(/)#e",
"#( )#e"
), "duh(\"\\1\")", $foo);
print $text;
this\ \(is\/a\)\ messed-up\ path
This was what I came up with. I'm sure there is an easier way but it worked for me... cheers.
--Thom
--
http://www.php.net/manual/en/function.escapeshellarg.php
http://master.php.net/manage/user-notes.php?action=edit+29977
http://master.php.net/manage/user-notes.php?action=delete+29977
http://master.php.net/manage/user-notes.php?action=reject+29977