Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php $data = array( 'count' => array("one", "two", "three"), 'dom' => ar..

Decoded Output download

<?php

$data = array(
  'count'      => array("one", "two", "three"),
  'dom'        => array("example", "com"),
  'dub'        => "me/too",
  'hello'      => "Hello World!",
  'half'       => "50%",
  'var'        => "value",
  'who'        => "fred",
  'base'       => "http://example.com/home/",
  'path'       => "/foo/bar",
  'list'       => array("red", "green", "blue"),
  'keys'       => array(
    "semi"  => ";",
    "dot"   => ".",
    "comma" => ",",
  ),
  'v'          => "6",
  'x'          => "1024",
  'y'          => "768",
  'empty'      => "",
  'empty_keys' => array(),
  'undef'      => null,
);

$templates = array(
  "{;who}",
  "{;half}",
  "{;empty}",
  "{;v,empty,who}",
  "{;v,bar,who}",
  "{;x,y}",
  "{;x,y,empty}",
  "{;x,y,undef}",
  "{;hello:5}",
  "{;list}",
  "{;list*}",
  "{;keys}",
  "{;keys*}"
);

$uris = array();

foreach ($templates as $template) {
  $uris[$template] = uri_template($template, $data);
}

var_export($uris);

/* Result */
/*
array(
  "{;who}"         => ";who=fred",
  "{;half}"        => ";half=50%25",
  "{;empty}"       => ";empty",
  "{;v,empty,who}" => ";v=6;empty;who=fred",
  "{;v,bar,who}"   => ";v=6;who=fred",
  "{;x,y}"         => ";x=1024;y=768",
  "{;x,y,empty}"   => ";x=1024;y=768;empty",
  "{;x,y,undef}"   => ";x=1024;y=768",
  "{;hello:5}"     => ";hello=Hello",
  "{;list}"        => ";list=red,green,blue",
  "{;list*}"       => ";list=red;list=green;list=blue",
  "{;keys}"        => ";keys=semi,%3B,dot,.,comma,%2C",
  "{;keys*}"       => ";semi=%3B;dot=.;comma=%2C"
)
*/
?>

Did this file decode correctly?

Original Code

<?php

$data = array(
  'count'      => array("one", "two", "three"),
  'dom'        => array("example", "com"),
  'dub'        => "me/too",
  'hello'      => "Hello World!",
  'half'       => "50%",
  'var'        => "value",
  'who'        => "fred",
  'base'       => "http://example.com/home/",
  'path'       => "/foo/bar",
  'list'       => array("red", "green", "blue"),
  'keys'       => array(
    "semi"  => ";",
    "dot"   => ".",
    "comma" => ",",
  ),
  'v'          => "6",
  'x'          => "1024",
  'y'          => "768",
  'empty'      => "",
  'empty_keys' => array(),
  'undef'      => null,
);

$templates = array(
  "{;who}",
  "{;half}",
  "{;empty}",
  "{;v,empty,who}",
  "{;v,bar,who}",
  "{;x,y}",
  "{;x,y,empty}",
  "{;x,y,undef}",
  "{;hello:5}",
  "{;list}",
  "{;list*}",
  "{;keys}",
  "{;keys*}"
);

$uris = array();

foreach ($templates as $template) {
  $uris[$template] = uri_template($template, $data);
}

var_export($uris);

/* Result */
/*
array(
  "{;who}"         => ";who=fred",
  "{;half}"        => ";half=50%25",
  "{;empty}"       => ";empty",
  "{;v,empty,who}" => ";v=6;empty;who=fred",
  "{;v,bar,who}"   => ";v=6;who=fred",
  "{;x,y}"         => ";x=1024;y=768",
  "{;x,y,empty}"   => ";x=1024;y=768;empty",
  "{;x,y,undef}"   => ";x=1024;y=768",
  "{;hello:5}"     => ";hello=Hello",
  "{;list}"        => ";list=red,green,blue",
  "{;list*}"       => ";list=red;list=green;list=blue",
  "{;keys}"        => ";keys=semi,%3B,dot,.,comma,%2C",
  "{;keys*}"       => ";semi=%3B;dot=.;comma=%2C"
)
*/
?>

Function Calls

uri_template 1

Variables

$data [{'key': 'count', 'value': [{'key': 0, 'value': 'one'}, {'key': 1, 'value': 'two'}, {'key': 2, 'value': 'three'}]}, {'key': 'dom', 'value': [{'key': 0, 'value': 'example'}, {'key': 1, 'value': 'com'}]}, {'key': 'dub', 'value': 'me/too'}, {'key': 'hello', 'value': 'Hello World!'}, {'key': 'half', 'value': '50%'}, {'key': 'var', 'value': 'value'}, {'key': 'who', 'value': 'fred'}, {'key': 'base', 'value': 'http://example.com/home/'}, {'key': 'path', 'value': '/foo/bar'}, {'key': 'list', 'value': [{'key': 0, 'value': 'red'}, {'key': 1, 'value': 'green'}, {'key': 2, 'value': 'blue'}]}, {'key': 'keys', 'value': [{'key': 'semi', 'value': ';'}, {'key': 'dot', 'value': '.'}, {'key': 'comma', 'value': ','}]}, {'key': 'v', 'value': '6'}, {'key': 'x', 'value': '1024'}, {'key': 'y', 'value': '768'}, {'key': 'empty', 'value': ''}, {'key': 'empty_keys', 'value': []}, {'key': 'undef', 'value': 0}]
$uris []
$template {;who}
$templates [{'key': 0, 'value': '{;who}'}, {'key': 1, 'value': '{;half}'}, {'key': 2, 'value': '{;empty}'}, {'key': 3, 'value': '{;v,empty,who}'}, {'key': 4, 'value': '{;v,bar,who}'}, {'key': 5, 'value': '{;x,y}'}, {'key': 6, 'value': '{;x,y,empty}'}, {'key': 7, 'value': '{;x,y,undef}'}, {'key': 8, 'value': '{;hello:5}'}, {'key': 9, 'value': '{;list}'}, {'key': 10, 'value': '{;list*}'}, {'key': 11, 'value': '{;keys}'}, {'key': 12, 'value': '{;keys*}'}]

Stats

MD5 03dc0aeeba79ed509823b78ce0802957
Eval Count 0
Decode Time 113 ms