Afternoon all 🙂
I'm having a problem with ereg_replace. Hopefully there's some way around it or if anyone else has any suggestions other than changing the trigger word.
I programmed an online letter template program for a probation office. In this program are set letters by the office where they can just go in and fill out the form fields. One of the letters includes 'short cut words' to insert various conditions from the terms and conditions contract. Theres 17 different condition, and for the program to recognize which condition to insert, I've setup ereg_replaces to change any instances of 'contract#' to the actual contract. So if a user types in ..
contract1
You have failed this condition.
The program will turn it into:
"THIS WOULD BE CONTRACT 1
You have failed this condition."
The problem I'm having is when a user puts in for example 'contract10' it spits out the data for contract 1. Which I gathered because it sees contract1 before the 0.
Does anyone know how I could get it to read the entire instance of the trigger word before it takes contract1?
If all else fails, I'll change the triggers to contractONE but want to avoid that if I can. Changing the code is easy, notifying all the users of the change and them getting used to it is the hard part 🙂