php - How I can replace <br /> with " " in a function -


 <?php  function show(){?>      <?php  echo "a"; ?>  <br />  }  //this function in file  <?php      echo str_replace("<br />"," ",show());//search  <br />  ?> 

how can replace <br /> " "?

you need buffer output. similar this:

ob_start(); show(); echo str_replace("<br />", " ", ob_get_clean()); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -