fork download
  1. <?php
  2.  
  3. $string='<div id="url">mamae</div>';
  4.  
  5.  
  6. $variavel = "url";
  7.  
  8. $var1 = explode('<div id="'.$variavel.'">',$string);
  9. $var2 = explode('</div>',$var1[1]);
  10.  
  11. $resultado = $var2[0];
  12.  
  13. echo $resultado;
Success #stdin #stdout 0s 82560KB
stdin
Standard input is empty
stdout
mamae