<?php
$str = "There are 5 monkeys in the tree";
sscanf($str, "There are %d monkeys in the %s", $num, $location);
echo $num . "\n";
echo $location . "\n";
$str = "first=value&arr[]=foo+bar&arr[]=baz";
parse_str($str, $output);
print_r($output);
echo "\n";
$str = "Hilla Warld";
$trans = array("H" => "H", "i" => "e", "a" => "o", "W" => "W", "r" => "r", "l" => "l", "d" => "d");
echo strtr($str, $trans);
echo "\n";
$str = "This is\tan example\nstring";
$token = strtok($str, " \n\t");
while ($token !== false)
{
echo "$token\n";
$token = strtok(" \n\t");
}
$str = "apple,banana,cherry";
print_r(explode(",", $str));
echo "\n";
?>