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
Explain what is meant by pear in php?
What is mysql_fetch_array?
Does facebook use php framework?
Explain me what is the use of 'print' in php?
How to redirect https to http url through .htaccess?
How to create a public static method in PHP?
"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.
What are the different data types in javascript?
What is a php trait?
How can you send http header to the client in php?
Do you know what is php?
Which php framework is in demand?
What are the string function in php?
What is Apache's configuration file typically called?
How to find the position of the first occurrence of a substring in a string?