PHP Classes

File: Serializer.example.php

Recommend this page to a friend!
  Classes of Yanik Gleyzer   Serializer   Serializer.example.php   Download  
File: Serializer.example.php
Role: Example script
Content type: text/plain
Description: Example of serializer using
Class: Serializer
Serialize data types in XML, JSON and PHP formats
Author: By
Last change:
Date: 16 years ago
Size: 332 bytes
 

Contents

Class file image Download
<?

require_once('/path/to/Serializer.class.php');

class
TestClass{
  var
$var;
  function
TestClass($var){
   
$this->var = $var;
  }
}

$ret = array('a1',
            
'abc'=>array('a','b','c'),
            
'object'=> (new TestClass('test var')));

$format = $_REQUEST['format'];


print
Serializer:serialize($ret,$format);

?>