Da traduttori professionisti, imprese, pagine web e archivi di traduzione disponibili gratuitamente al pubblico.
ולהיפך, unserialize() בודק נוכחות של פונקציה עם מילת הקסם __wakeup. אם המילה נוכחת, פונקציה זו יכולה לבנות מחדש מקור כלשהו שיכול להיות לאובייקט.
si elle existe, cette fonction reconstruit toutes les ressources d 'un objet.
Ultimo aggiornamento 2011-10-24
Frequenza di utilizzo: 1
Qualità:
/ / here, we use unserialize() to load session data to the / / $session_data array from the string selected from a database. / / this example complements the one described with serialize(). $conn = odbc_connect ("webdb", "php", "chicken"); $stmt = odbc_prepare ($conn, "select data from sessions where id = ?"); $sqldata = array ($php_auth_user); if (!odbc_execute ($stmt, $sqldata) _bar_ _bar_ !odbc_fetch_into ($stmt, $tmp)) {/ / if the execute or fetch fails, initialize to empty array $session_data = array();} else {/ / we should now have the serialized data in $tmp[0]. $session_data = unserialize ($tmp[0]); if (!is_array ($session_data)) {/ / something went wrong, initialize to empty array $session_data = array();}}
cet exemple complète / / celui fourni avec serialize(). $conn = odbc_connect ("webdb", "php", "chicken"); $stmt = odbc_prepare ($conn, "select data from sessions where id = ?"); $sqldata = array ($php_auth_user); if (!odbc_execute ($stmt, $sqldata) _bar_ _bar_ !odbc_fetch_into ($stmt, $tmp)) {/ / si la préparation ou la lecture échoue, on crée un tableau vide $session_data = array();} else {/ / les données sauvées sont dasn $tmp[0]. $session_data = unserialize ($tmp[0]); if (!is_array ($session_data)) {/ / erreur... initialisation à tableau vide $session_data = array();}}?
Ultimo aggiornamento 2011-10-24
Frequenza di utilizzo: 1
Qualità:
Attenzione: contiene formattazione HTML nascosta