Prepara un string en PHP para ingresarlo en codigo Javascript


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.