Re: Need heavy duty character escaping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hmm.... or just:

$info = str_replace('$', '\$', $info);

Seems to work so far, in conjunction with htmlentities.


On Mon, Nov 4, 2013 at 4:21 PM, leam hall <leamhall@xxxxxxxxx> wrote:

> I'm still pulling out some XML and putting it into different formats. One
> issue I'm having right now is that one of the sections contains Linux
> commands, with pretty much every special character possible. When trying to
> write this so that section becomes a PHP string it chokes on the special
> characters.
>
> Most notably $, but also { } and [ ]. I've tried htmlspeciachars and
> addslashes, but need more. Using mysqli_real_escape_string seems to need a
> DB connection.
>
> Do I need to regex this or is there a better way?
>
> Thanks!
>
> Leam
>
> --
> Mind on a Mission <http://leamhall.blogspot.com/>
>



-- 
Mind on a Mission <http://leamhall.blogspot.com/>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux