fork(4) download
  1. <?php
  2.  
  3. $s = "acesta este un text";
  4. $sir = "stiu PHP stiu HTML stiu CSS";
  5.  
  6. # afisez o sectiune din sir
  7. echo substr( $sir, 0, 4), "\n"; // stiu
  8. echo substr( $sir, 5 ), "\n"; // PHP stiu HTML stiu CSS
  9. echo substr( $sir, 5, -3 ), "\n"; // PHP stiu HTML stiu
  10. echo substr( $sir, -3 ), "\n"; // CSS
  11.  
  12. # returnez doar un caracter din string
  13. echo $sir{5}, "\n"; // P
  14. echo $sir{ strlen($sir)-1 }, "\n"; // S
  15.  
  16. ?>
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
stiu
PHP stiu HTML stiu CSS
PHP stiu HTML stiu 
CSS
P
S