Hello,
I am using php to take input text from an html form and output it in an xml file. I am using preg_replace to replace certain portions of content. I am having trouble though with the delimiters.
This is what I want to do
Input : “I ate lunch”
Output: “LUNCH”
As i have it set up now, the delimiters work fine if i use ‘/Today I ate lunch/’, and the replacement string as ‘lunch’
The problem i have is that I don’t understand how to use delimeters when dealing with non-alphanumeric variables. One of the lines ii need to condense into a concise version goes something like this:
Input: “I ate lunch at 5-6 (different) places w/billy this wk”
For this I’m unsure how I need to use delimiters because the forward slash is actually in the phrase. I have tried this but it doesn’t seem to work. Do i need to use a new non-alphanumeric symbol for each character?
Input: “[I ate lunch at 5*–*(*)*/
I hope someone can help me understand this. It would help me a lot.
Best,
-A