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

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- parse_ini_string() typed scanner mode --FILE-- <?php $contents = <<<EOS foo = 1 ..

Decoded Output download

--TEST--
parse_ini_string() typed scanner mode
--FILE--
<?php

$contents = <<<EOS
foo = 1
bar = 1.3
baz = null
qux[] = false
qux[] = off
qux[] = something
qux[] = "something else"
EOS;

var_dump(parse_ini_string($contents, false, INI_SCANNER_TYPED));

?>
Done
--EXPECT--
array(4) {
  ["foo"]=>
  int(1)
  ["bar"]=>
  float(1.3)
  ["baz"]=>
  NULL
  ["qux"]=>
  array(4) {
    [0]=>
    bool(false)
    [1]=>
    bool(false)
    [2]=>
    string(9) "something"
    [3]=>
    string(14) "something else"
  }
}
Done

Did this file decode correctly?

Original Code

--TEST--
parse_ini_string() typed scanner mode
--FILE--
<?php

$contents = <<<EOS
foo = 1
bar = 1.3
baz = null
qux[] = false
qux[] = off
qux[] = something
qux[] = "something else"
EOS;

var_dump(parse_ini_string($contents, false, INI_SCANNER_TYPED));

?>
Done
--EXPECT--
array(4) {
  ["foo"]=>
  int(1)
  ["bar"]=>
  float(1.3)
  ["baz"]=>
  NULL
  ["qux"]=>
  array(4) {
    [0]=>
    bool(false)
    [1]=>
    bool(false)
    [2]=>
    string(9) "something"
    [3]=>
    string(14) "something else"
  }
}
Done

Function Calls

None

Variables

$contents foo = 1 bar = 1.3 baz = null qux[] = false qux[] = off qux[]..

Stats

MD5 80fda8385d6b4b7db0daa139bcfc5012
Eval Count 0
Decode Time 81 ms