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 / nilsoft
<?php
$string = '||25||34||73||94||116||128';
$require_array =
explode("||",substr($string,2,strlen($string)-2));
print_r($require_array);
?>
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How many data types are there in php?
How we get browser details of clients machine?
When to use self over $this?
How is it possible to know the number of rows returned in the result set?
What is the current stable version of php?
Tell me how can we pass the variable through the navigation between the pages?
What are escaping characters?
"mysql_fetch_row — Get a result row as an enumerated array",this sentence comes from the PHP offical manual.However ,i can not understand the words "enumerated array".I need some help.Thanks a lot to everyone that reply.
Which escape sequences can be used in single quoted strings in php?
How does php session work?
How stop the execution of a php scrip?
What is the correct syntax of mail() function in php?
How do you identify independent and dependent variables in regression analysis?
Where are the persistent cookies stored on your computer?
Define urlencode() and urldecode() used in php?