PHP serialize() function
In this chapter you will learn:
Description
We can use serialize() to save objects into a string, then use urlencode() to get a format suitable for the web.
Syntax
PHP serialize() has the following syntax.
serialize($aVariable);
Example
Serialize a class
<?PHP//from j a va 2 s.c o m
class ComputerBook{ }
$aBook = new ComputerBook;
$safepoppy = urlencode(serialize($aBook));
?>
Next chapter...
What you will learn in the next chapter:
- Description for PHP boolval function
- Syntax for PHP boolval function
- Parameter for PHP boolval function
- Return value for PHP boolval function
- Example - What is the boolean value for converted from real value
Home » PHP Tutorial » PHP Class Functions