Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do i explode this string '||25||34||73||94||116||128' i
need to have a array like this

array (
0 => '25',
1 => '34',
2 => '73',
3 => '94',
4 => '116',
5 => '128'
)

explode("||", $array); didnt work for me i get this array

array (
0 => '',
1 => '25',
2 => '34',
3 => '73',
4 => '94',
5 => '116',
6 => '128',
)

Answer Posted / rekha_sri

Use the following program.It will remove the beginning ||.

?php
$string='||25||34||73||94||116||128';
$array = explode('||', trim($string, '|'));
print_r($array);
?>
~

Is This Answer Correct ?    23 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What u mean by query?

1114


What are the rules to determine the “truth” of any value which is not already of the boolean type?

989


how to use http headers inside php? Write the statement through which it can be added?

1079


Name some of the functions in php.

1091


What is the difference between $name and $$name?

1058


How to get useful error messages in php?

1098


What is polymorphism with example in php?

1006


How are sessions maintained?

987


What is meant by public, private, protected, static and final scopes?

1087


What is difference between mysql_connect and mysqli_connect?

1111


Which is faster for or foreach php?

1000


Write a program to swap two numbers using php.

1103


What is json php?

1068


What is php oops concepts?

1071


What is php sequence?

989