...

View Full Version : Processing PHP



Phil Jackson
01-16-2010, 04:16 PM
Hi, im trying to escape php code to convert all into html references ie


$str = "$_GET['foo'];"
echo encodeString($str);

but $str would convert into what ever that var is but I don't want to do that.
i want to convert the ' into ' and the $ into $. Anyone know how?

masterofollies
01-16-2010, 04:37 PM
$new = htmlspecialchars($_GET['foo']);
echo "$new";

Try that.

http://php.net/manual/en/function.htmlspecialchars.php

JAY6390
01-16-2010, 05:26 PM
$str = '$_GET[\'foo\']';
echo htmlentities($str);Like that? Not really syre what you're trying to do with $_GET['foo']

oesxyl
01-17-2010, 07:22 AM
Hi, im trying to escape php code to convert all into html references ie


$str = "$_GET['foo'];"
echo encodeString($str);

but $str would convert into what ever that var is but I don't want to do that.
i want to convert the ' into ' and the $ into $. Anyone know how?
http://www.php.net/manual/en/function.htmlspecialchars-decode.php

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum