Please, how can I replace $example to %example% using PHP? I am a novice.
For example, I have –
<textarea>hi %myusername%</textarea>
<input submit>
I want, if submitted, the %myusername% should change to $user and save to my database.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A simple string replacement method would work fine for this. Take a look at
str_replace()–With regard to saving this data to a database, it really depends on your implementation. All you’ll really have to do is place this value into an sql
INSERTquery.