StefaanC Posted June 11, 2015 Share Posted June 11, 2015 I have this line in my php code: $txt = htmlentities($txt, ENT_SUBSTITUTE | ENT_HTML5 ,"ISO-8859-1"); On my homecomputer (using Xampp Control Panel v3.2.1) this works as espected.On stevie I get this error (warning): Warning: htmlentities() expects parameter 2 to be long, string given in... What is going on and how should I resolve this? Thanks ! Quote Link to comment Share on other sites More sharing options...
Tjoene Posted June 11, 2015 Share Posted June 11, 2015 Stevie is running PHP version 5.3.8 at the moment. The constants ENT_SUBSTITUTE and ENT_HTML5 were added in PHP version 5.4.0.That means that stevie doesn't support them at the moment. One way is to remove those constants or define them: <?php if (!defined('ENT_SUBSTITUTE')) { define('ENT_SUBSTITUTE', 8); } if (!defined('ENT_HTML5')) { define('ENT_HTML5', 48); } $txt = 'hello world <html>'; $txt = htmlentities($txt, ENT_SUBSTITUTE | ENT_HTML5 ,"ISO-8859-1"); echo $txt; ?> 1 Quote Link to comment Share on other sites More sharing options...
StefaanC Posted June 11, 2015 Author Share Posted June 11, 2015 Thank you very much ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.