Php arrays and strings are converted to each other. The data structure is the same as a function used to describe PHP Data. The returned value is a string. Sometimes, in order to convert some data into strings, we hope to keep the original data structure and content. This function is required. $ Aarray (data & gt; hi, 123); $ bserialize ($ a); serialize the array echo $ B ;? This is the mutual conversion between php arrays and strings described, and the data structure remains unchanged.
A function that describes PHP Data. The returned value is a string. Sometimes, in order to convert some data into strings, we hope to keep the original data structure and content. This function is required.
$ A = array ('data' => "hi", 123 );
$ B = serialize ($ a); // serialize the array
Echo $ B ;? // This is the described array, but it is a string here.
$ C = unserialize ($ B); // restore the described data (deserialization)
Print_r ($ c );?? // Restore to $ a, and the array structure is not lost.