If the userprofiles built as such, then use the below code:
$user = array("name" => "dubayou",
"age" => 20,
"websites" => array("dubayou.com","willwharton.com","codecream.com"),
"and_one" => "more");
To save or update the DB record for that user, use the below query:
$dir = "../userdata/"; //But, make sure to put it bellow so that the server can reach.
file_put_contents($dir.$user['name'],serialize($user));
To load the record for the user, you can do this:
function &get_user($name){
return unserialize(file_get_contents("../userdata/".$name));
}
But, the above implementation will vary on the application and nature of the database according to your needs.