fork download
  1. <?php
  2.  
  3. $frase = 'tem refrigerante na geladeira';
  4. $pergunta = 'tem';
  5. $local = 'na geladeira';
  6.  
  7. $item = trim(preg_replace("/$pergunta|$local/", "", $frase));
  8.  
  9. echo $item;
  10.  
Success #stdin #stdout 0.02s 23856KB
stdin
Standard input is empty
stdout
refrigerante