PageRenderTime 48ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): GPL-2.0, 0BSD, BSD-3-Clause, Unlicense, MPL-2.0-no-copyleft-exception, LGPL-2.1
  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. ?>