Hi, My site suddenly start giving error and i don't know how to fix it, i do not know much php Warning: stripslashes() expects parameter 1 to be string, array given in /home4/paarth31/public_html/quality3d/index.php on line 63 can anyone pls fix this error. regards
Have you changed any of the code? Or has a feed into your site changed? Can you show us what is on line 63?
Hi, 63 while(stripslashes($rows1=mysql_fetch_array($result1))) this error is on all over the site website is quality3dmodels.net and no, i have not changed anything someone also told me to degrade your php version to 5.3 regards
Somebody has changed something mysql_fetch_array is deprecated which means you shouldn't be using it anymore. I'm on my ipad at the moment so can't view source, what cms are you using? are you on the latest version? can you upgrade it?
mysql_fetch_array function will return an Array Object. And stripslashes function is work on String variable. That's all. And if you want to apply stripslashes function on each values of array. Then use array_map. <?php function stripslashes_fun($value) { $value = is_array($value) ? array_map('stripslashes_fun', $value) : stripslashes($value); return $value; } $finelResult = stripslashes_fun(mysql_fetch_array($result1)); /* suppose mysql_fetch_array($result1) = array("n\\'ame", "te\\'st", array("he\\'llo")); */ print_r($finelResult); ?> ==================Output================== Array ( [0] => n'ame [1] => te'st [2] => Array ( [0] => he'llo ) )