1
$regex = '/\s/';
$strng = "This is a sentence";
$array = preg_split($regex, $strng);
foreach($array as $element)
print "$element
";
// 2
?>2
$regex = '//';
$strng = "This is a sentence";
$array = preg_split($regex, $strng);
foreach($array as $element)
print "$element
";
// 3
?>3
$regex = '/[\+\*\/\-]/';
$strng = '3 + 5 * 9 / 2';
$array = preg_split($regex, $strng);
foreach($array as $element)
print "$element
";
// 4
?>4
$regex = '/\//';
$strng = $PHP_SELF;
$array = preg_split($regex, $strng);
foreach($array as $element)
print "$element
";
?>