I need to create a php search function for names and need to change LastName, FirstName into LastName..FirstName to search the database. I don’t know if this helps, but the string will originally be in the form a variable ($Client).
I need the syntax for the three statements that find the string, matches, and makes the changes.
If you’d like to use a regular expression:
Regular expression explanation
All that being said,
str_replacecan do the trick if you will always have"Doe, John"(with one space)