If the wishlist is an array, you could serialize it and store it in a text file. You'll need a file for each user and you'll need to make sure the username doesn't contain any illegal characters (such as slashes, etc) otherwise it could be a security risk.
Serializing stores a PHP variable as a text string. You can convert it back to a variable by calling 'unserialize';
$wishlist = array ('one', 'two', 'three');
$username = 'daniel';
// Check username only contains letters or numbers
if (preg_match ('/^[a-zA-Z0-9]*$/', $username))
{
// Convert $wishlist to an array
$data = serialize ($wishlist);
// Store in a text file
if (file_put_contents ("wishlists/$username.txt", $data))
{
echo "Ok.\n";
}
else
{
// Make sure you've created 'wishlists' directory
echo "Error.\n";
}
}
else
{
echo "Username contains illegal characters.\n";
}
// Load wishlist from file
if ($data = file_get_contents ("wishlists/$username.txt"))
{
$wishlist = unserialize ($data);
print_r ($wishlist);
}
else
{
echo "Cannot load file.\n";
}