split a string into array of strings formed by the string delimiter.

If i have a string like :

$str=”D:/newfolder/kumar/gandhi”;

Then to seperate the string $str with ‘/’ as delemiter we have to use the function available explode() in PHP.

Its very usefull when we are sending group of data from Flex and splitting it using the function in PHP explode().For our calculation.

using the function :

$str1=explode(“/”,$str);

now using the string $str1 as array which contains the splitted string..

for($i=0;$i<=$str1.length;$i++)

{

echo $str1[$i].”</br>”;

}

Now this will print the string as –>

D:

newfolder

kumar

gandhi

Hence the usage of explode() function..

Advertisements

One Response to split a string into array of strings formed by the string delimiter.

  1. glidmedel says:

    glidmedel…

    […]split a string into array of strings formed by the string delimiter. « flex on blog – by kumar[…]…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: