<?php
$h='my home is my castle';
$n='is';
$part = stristr($h,$n,true);
$part2 = stristr($h,$n);
if (version_compare(PHP_VERSION, '5.0.0', '>=')) {
if($pos=stripos($h,$n)) $part3=substr($h,0,$pos);
}else
echo 'I am using PHP 4, my version: ' . PHP_VERSION . "\n";
}
$h=strtolower($h);
$n=strtolower($n);
if($pos=strpos($h,$n)) $part4=substr($h,0,$pos);
echo "This is my: $part\n";
echo "That is my: $part2\n";
echo "Also, this: $part3\n";
echo "This too: $part4\n";
?>
- Output for 5.3.0 - 5.3.14, 5.4.0 - 5.4.4
- Parse error: syntax error, unexpected '}' in nsKae on line 10
Process exited with code 255.
preferences:
159.38 ms | 1399 KiB | 27 Q