문제

Here is my code

$user_data = "I'm awesome";
echo $user_data;

This for some reason echoes I\'m awesome in my site. I found this odd and weird. I put it in a variable because the value of this changes within the action of a function, searching through a MySQL Database. I cannot find the problem. Please HELP!

도움이 되었습니까?

해결책

I would use stripslashes() function

$user_data = "I'm awesome";
$user_data = stripslashes($user_data);
echo $user_data;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top