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
What is the basic function to search files for lines (or other units of text) that contain a pattern.
What is csrf token and why it is required?
Write the statements that are used to connect php with mysql
What are the options to transfer session ids?
How to remove a file?
What does the expression exception::__tostring means?
What is the function of trim?
What is the goto statement useful for?
What are the four scalar types of php?
What's the difference between accessing a class method via -> and via ::?
What is pdo classes?
How to genrate report in wordpress cms
How are sessions maintained?
What is the timeout period on session values?
How to execute a function in php?