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

How to calculate the difference between two dates using php?

986


Which is better #define or enum?

906


What is csrf token and why it is required?

910


Tell me what is pear?

953


Which is used to maintain the value of a variable over different pages?

970


Is it possible to use com component in php?

926


Require_once(), require(), include(). What is difference between them?

933


Is apache needed for php?

863


What is the use of 'print' in php?

961


What are the methods of array in java?

905


What is the difference between $argv and $argc? Give example?

914


What are the uses of explode() function?

994


What is the difference between array_map () and array_shift ()?

948


What does it mean when it says the csrf token is invalid?

852


Name and explain five of the PHP error constants?

894