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-- Bug #46347 (parse_ini_file() doesn't support * in keys) --FILE-- <?php $str = <<..

Decoded Output download

--TEST--
Bug #46347 (parse_ini_file() doesn't support * in keys)
--FILE--
<?php

$str = <<< EOF
[section]
part1.*.part2 = 1
EOF;

$file = __DIR__ . '/parse.ini';
file_put_contents($file, $str);

var_dump(parse_ini_file($file));
?>
--CLEAN--
<?php
unlink(__DIR__.'/parse.ini');
?>
--EXPECT--
array(1) {
  ["part1.*.part2"]=>
  string(1) "1"
}

Did this file decode correctly?

Original Code

--TEST--
Bug #46347 (parse_ini_file() doesn't support * in keys)
--FILE--
<?php

$str = <<< EOF
[section]
part1.*.part2 = 1
EOF;

$file = __DIR__ . '/parse.ini';
file_put_contents($file, $str);

var_dump(parse_ini_file($file));
?>
--CLEAN--
<?php
unlink(__DIR__.'/parse.ini');
?>
--EXPECT--
array(1) {
  ["part1.*.part2"]=>
  string(1) "1"
}

Function Calls

None

Variables

$str [section] part1.*.part2 = 1

Stats

MD5 5943da43ab3f12147559a7d34cb56b86
Eval Count 0
Decode Time 73 ms