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
What is the current stable version of php? What advance thing in php7?
What is the current stable version of php?
List some features of php that are deprecated in php7?
Name and explain five of the PHP error constants?
How to create a web form?
What is the difference between htmlentities() and htmlspecialchars()?
How to calculate the difference between two dates using php?
sort term descripttion form, report and uery
What is difference between static and final in php?
What is trait in php?
if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer
What sized websites have you worked on in the past?
Write a program using while loop?
hello all, I need some sample placement papers in lion bridge.. can anyone help me?
how to detect a mobile device using php