use FormatForge\Factory\JsonFactory; $data = array('foo' => 'bar', 'baz' => 'qux'); $json = JsonFactory::create()->format($data); // {"foo":"bar","baz":"qux"}
use FormatForge\Factory\XmlFactory; $data = array('foo' => 'bar', 'baz' => 'qux'); $xml = XmlFactory::create()->format($data); /**/ bar qux
use FormatForge\Factory\CsvFactory; $csv = "foo,bar\nbaz,qux"; $rows = CsvFactory::create()->parse($csv); /* array( array('foo', 'bar'), array('baz', 'qux') ) */PHP Format Forge is a standalone library and does not depend on any other package or library.