How To Use Explode() Php Function Examples



How To Use Explode() Php Function Examples
How To Use Explode() Php Function Examples
Post Description:
Post Tags: how, to, use, explode, php, function, examples
This Post Has Been Viewed 332 Times Since Wed Jun 20, 2007 12:47 pm Posted By beginer tutorial with 1 replies
How To Use Explode() Php Function Examples
can you tell how i can use php explode() function?

if i have this for example, how can i display the array in a loop?

<?
$string = "simple sentence with five words";
$words= explode(" ", $string );
?>

Leave Your Comments     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About How To Use Explode() Php Function Examples




:: 1 :: #7412 - Reply By webune On Wed Jun 20, 2007 12:55 pm
sure you can, you can use the for loop to get and disaply all the values of the array.

CODE:
<?
$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!