0.1.3 • Published 10 years ago

pdp v0.1.3

Weekly downloads
3
License
-
Repository
github
Last release
10 years ago

pdp === PHP Dump Parser

Node.js parser of PHP var dumps.

build
status

Install

npm install mongohooks

Usage (or what is a PHP dump?)

Given a variable, the PHP function print_r will print human-readable information about the variable. This is best illustrated with an example:

<pre>
<?php
$a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x', 'y', 'z'));
print_r ($a);
?>
</pre>

The above example will output:

<pre>
Array
(
    [a] => apple
    [b] => banana
    [c] => Array
        (
            [0] => x
            [1] => y
            [2] => z
        )
)
</pre>

Feed the above output inside the <pre> tags to this module and you get a nice JavaScript object literal or Array:

var pdp = require('pdp');
var dump = '...'; // let's imagine we have the entire Array(...) dump here
consonle.log(pdp(dump)); // prints: { a: 'apple', b: 'banana', c: [ 'x', 'y', 'z' ] }

License

MIT

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago