I am using PHP 7.1.8
and I am trying to query my db. However, the serialized arrays have special characters, which are shown as the following: �
Find below an example of my code:
// connect to db
$dbname = $conf['dbName'];
$dbuser = $conf['user'];
$dbpass = $conf['pwd'];
$dbhost = $conf['host'];
// Create connection
$conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
$arr = $conn->query("SELECT * FROM postmeta WHERE post_id = "100" and meta_key = 'val' LIMIT 1;")->fetch_assoc()["meta_value"];
When querying the database directly, I get the correct value for �
. See below my ``$arr`:
This error results basically in that I cannot unserialize
the data correctly.
Any suggestions how to fix this error?
I appreciate your replies!