RE: [PHP] Escaping JavaScript strings

2008-05-29 Thread Edward Kay
> > This is a PHP function that escapes strings so you can output them as a > JS string. IIRC it assumes you're using single quotes to enclose your > strings. > > /** > * Function to appropriately escape a string so it can be output > * into javascript code. > * > * @p

Re: [PHP] Escaping JavaScript strings

2008-05-29 Thread Richard Heyes
> ... This is a PHP function that escapes strings so you can output them as a JS string. IIRC it assumes you're using single quotes to enclose your strings. /** * Function to appropriately escape a string so it can be output * into javascript code. * * @param string $stri