How To Use Explode() Php Function Examples
Webune
how to use explode() php function examples
how, to, use, explode, php, function, examples
Home
Forums
SEO Forums
»
Programming
»
PHP
»
How To Use Explode() Php Function Examples
How To Use Explode() Php Function Examples
Post Description: how to use explode() php function examples
how, to, use, explode, php, function, examples
This Post Has Been Viewed 294 Times Since Fri Feb 29, 2008 12:01 pm Posted By beginer tutorial with 1 replies
POST# 417
Posted On: Fri Feb 29, 2008 12:01 pm
beginer tutorial
Topic: 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 );
?>
Wed Jun 20, 2007 12:55 pm
1
webune
Reply #1006
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!
What do you think?
* name:
* email:
* Please enter comments:
Receive Replies on my Comments
(
An email will be sent to you when someone replies to your comments
)
Add image to comments
yes
no
submit
Next
remove certain last characters from a string in php
Previous:
How To Create Make PHP Forms Using Form Arrays Tutorial