/test/subjects/benchmarks/php_bs/xml/explode.inc.php

http://phc.googlecode.com/ · PHP · 17 lines · 14 code · 3 blank · 0 comment · 1 complexity · 6921e2d03dca35e9828723d334716a32 MD5 · raw file

  1. <?php
  2. function bench1()
  3. {
  4. global $XML;
  5. $arr = array();
  6. $x = explode("<title>",$XML);
  7. foreach($x as $v) {
  8. $pos = strpos($v,'</title>');
  9. $v = substr($v,0,$pos);
  10. if ($v) $arr[] = $v;
  11. }
  12. return $arr;
  13. }
  14. ?>