fork(4) download
  1. <?php
  2.  
  3. $s = "acesta este un text";
  4. $sir = "stiu PHP stiu HTML stiu CSS";
  5.  
  6. # verific daca un cuvant sau text (in cazul de fata cuvantul 'PHP') apare in
  7. # sirul exprimat prin variabila $sir
  8. if( strstr( $sir, 'PHP' ) !== false ) print 'gasit';
  9. else print "nu am gasit";
  10.  
  11. print "\n";
  12. # pentru a nu tine cont de litere mari/mici se foloseste stristr
  13. if( stristr( $sir, 'phP' ) !== false ) print 'gasit';
  14.  
  15. ?>
  16.  
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
gasit
gasit