How to remove part of a string?


Question

How to trim a part of a string, and save it in a particular string in MySQL using PHP?

Example string : "REGISTER 11223344 here"

How can I remove "11223344" from example string?

1
136
11/18/2016 6:57:32 AM

If you're specifically targetting "11223344", then use str_replace:

echo str_replace("11223344", "", "REGISTER 11223344 here");
182
2/3/2010 1:33:19 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon