'; $config = Array( 'username' => 'wrs', // username ( string ) 'accesslevel' => 3, // access level ( integer ) 'showemail' => false, // some other var ( boolean ) ); var_dump($config); // With serialize() we can convert this entire PHP array in to one string, which can be written to file/database for later retrieval $data = serialize($config); // $data should now be something like: // a:3:{s:8:"username";s:3:"wrs";s:11:"accesslevel";i:3;s:9:"showemail";b:0;} echo $data."\n"; // which can easily be saved to file/database // to get our array back $newconfig = unserialize($data); var_dump($newconfig); // contents of $config and $newconfig should be exactly the same. ?>