You are here: Re: php in javascript « PHP Programming Language « IT news, forums, messages
Re: php in javascript

Posted by fletch on 04/24/06 11:53

You need to have valid javascript code, which is not happening when you
have several lines in text. You want to get to
output +="Line1\nLine2\nLine3\n"; // += is the same as a=a+
so
<? function jsencode($str)
{
return implode('\n',explode("\n",$str)); //Could use str_replace -
probably better.
}?>

output+="<? echo jsencode($text); ?>";

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация