Hello,
The following code is part of larger script that worked in php 5.3
//Translate string ($str) to UTF-8 from given charset
function strToUtf8($str){
$chars = unpack('C*', $str);
$cnt = count($chars);
for($i=1;$i<=$cnt;$i++) {
//echo "Char->" . $chars[$i];
$this->_charToUtf8(&$chars[$i]);
//echo " utf8->" . $chars[$i] . "<br>";
}
$returnstr = implode("",$chars);
//echo "Return after implode() " . $returnstr;
return $returnstr;
}
However:
Under php 7.1 i get a syntax error ( syntax error, unexpected '&' in your code ) on this line:
$this->_charToUtf8(&$chars[$i]);
Can someone suggest changes for the code so it will work under 7.1?
Thanks in advance
GeeJay