how to use explode() php function examples
RegisterLogin
how to use explode() php function examples
Post Description: how to use explode() php function examples
Tags: how, to, use, explode(), php, function, examples
This Post Was Posted On Feb 29, 2008 By beginer tutorial #1258
Post Description: how to use explode() php function examples
Tags: how, to, use, explode(), php, function, examples
This Post Was Posted On Feb 29, 2008 By beginer tutorial #1258
how to use explode() php function examples by beginer tutorial
if i have this for example, how can i display the array in a loop?
<?
$string = "simple sentence with five words";
$words= explode(" ", $string );
?>
$string = "simple sentence with five words";
$words= explode(" ", $string );
?>
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
webune
#1687 1
sure you can, you can use the for loop to get and disaply all the values of the array.
CODE:
OUTPUT:
0. simple
1. sentence
2. with
3. five
4. words
hope this helps.
php web hosting at webune.com!
CODE:
<?
$string = "simple sentence with five words";
$words = explode(" ", $string );
for( $i = 0; $i < count($words); ++$i )
echo $i.'. '.$words[$i].'<br>';
?>
$string = "simple sentence with five words";
$words = explode(" ", $string );
for( $i = 0; $i < count($words); ++$i )
echo $i.'. '.$words[$i].'<br>';
?>
OUTPUT:
0. simple
1. sentence
2. with
3. five
4. words
hope this helps.
php web hosting at webune.com!
Jun 20, 2007 Reply Report abuse
©2011 Webune Forums - Fri Dec 30, 2011 12:50 am
Powered by: Webune Forums V3
Powered by: Webune Forums V3