mirror of
https://github.com/php/web-php.git
synced 2026-03-24 07:12:16 +01:00
28 lines
606 B
PHP
28 lines
606 B
PHP
<?php require "header.inc"?>
|
|
<H1>String Handling</H1>
|
|
|
|
<?example('<?php
|
|
$a = explode(":", "This:string:has:delimiters.");
|
|
while (list(,$value) = each($a)) {
|
|
if (strcmp($value, "has") == 0) {
|
|
echo "had ";
|
|
} else {
|
|
echo $value." ";
|
|
}
|
|
}
|
|
?>');?>
|
|
<H6>Output:</H6><BLOCKQUOTE>
|
|
<?php
|
|
$a = explode(":", "This:string:has:delimiters.");
|
|
while (list(,$value) = each($a)) {
|
|
if (strcmp($value, "has") == 0) {
|
|
echo "had ";
|
|
} else {
|
|
echo $value." ";
|
|
}
|
|
}
|
|
?>
|
|
</BLOCKQUOTE>
|
|
|
|
<?php require "footer.inc"?>
|