Siglo99 Posted August 10, 2016 Share Posted August 10, 2016 Hello friends This problem has troubled me for a long time,Find a solution Please guide me to understand people, to solve the following errors PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/mayorist/public_html/tools/smarty/plugins/modifier.escape.php on line 40 thank you all Link to comment Share on other sites More sharing options...
ovy79ro Posted August 10, 2016 Share Posted August 10, 2016 Hello, htmlspecialchars function require only string parameter. The syntax is: htmlspecialchars(string,flags,character-set,double_encode) For example: $string = 'My name is John'; echo htmlspecialchars($string); If your $string variable is an array, you get the error like in your post. Link to comment Share on other sites More sharing options...
Kogkalidis Posted April 6, 2019 Share Posted April 6, 2019 @ovy79ro indeed. I study code from a commercial module to make something new and at some point, via tpl, it uses the product name. This is a table (due to multi-lingual setup). You made my day Link to comment Share on other sites More sharing options...
Kogkalidis Posted October 17, 2019 Share Posted October 17, 2019 Back to back: I made an admin controller and the respective class and db table. The field was NOT an array or object BUT: In the constructor I took the same field (let's name it "field") and started an object without noticing that they do share the same name. My bad Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now