0

Working on a Project where I need to compare 2 strings. One is from database and another is coming from post variable, so

If string is small then if($var1 == $var2) is working fine but if strings are big then this is not working fine if both are same although it is going in else condition and string is coming from PHP HTML Editor menas like a word file

Example of very very very small string which I want to save in database if post value is not equal to database value I am using 2 function also for convert string

mysql_real_escape_string()

nl2br(stripslashes())

<span style=\"font-size: 24px; font-weight: bold; text-indent: -23.799999237060547px; font-family: Symbol; background-color: yellow;\"></span><span style=\"font-size: 24px; font-weight: bold; text-indent: -23.8px; background-color: yellow; color: red;\">1</span><span style=\"font-size: 24px; font-weight: bold; text-indent: -23.8px; background-color: yellow; color: red;\"><br /></span>
4

2 回答 2

1

尝试这个

$var1 //string1
$var2 //string2

if(strcmp($var1, $var2))
于 2013-06-28T15:39:00.407 回答
0

你可以 md5 他们然后比较 md5 版本...

你在数据库中保留一个字符串的 md5,然后你 md5 POST

于 2013-06-28T15:42:40.617 回答