escape single quote

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 18
Joined: Mon Mar 19, 2018 8:57 am

Fri Mar 30, 2018 8:58 am

I am having a problem on the output form escaping a single quote as in typing in the input field Alex's It won't escape the apostrophe or single quote on output and gives me a syntax error. I understand that this \' is to escape the single quote. What am I doing wrong in my below script? Thank you in advance...

<? echo "\'$_POST[position]\'"; ?></p>

User avatar
php-forum Fan User
php-forum Fan User
Posts: 775
Joined: Mon Feb 22, 2016 5:52 pm

Fri Mar 30, 2018 10:47 am

What am I doing wrong in my below script?
Multiple posting of the same thing and ignoring previous advice.

Post Reply