Please provide the XML filename as a command-line argument: php -f xml2json_test.php test1.xml