I have a string like this:
" 23 PM"
I would like to remove 23
so I’m left with PM
or (with space truncated) just PM
.
Any suggestions?
Needs to be in PHP
Advertisement
Answer
echo trim(str_replace(range(0,9),'',' 23 PM'));
I have a string like this:
" 23 PM"
I would like to remove 23
so I’m left with PM
or (with space truncated) just PM
.
Any suggestions?
Needs to be in PHP
echo trim(str_replace(range(0,9),'',' 23 PM'));