Posted By

cochambre on 06/30/06


Tagged

javascript php error String


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

postNuKe
takushi
nicolaspar
vali29


Prepara un string en PHP para ingresarlo en codigo Javascript


 / Published in: PHP
 

  1. function jsstring($string){
  2. $nl = "
  3. ";
  4. $search = array($nl,"'");
  5. $replace = array(' ','\'');
  6. return str_replace($search,$replace,$string);
  7. }

Report this snippet  

You need to login to post a comment.