summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
42a72c0)
just replace "*/ ?>" and "<?php /*" with '' and "Trim" output whatever is EOF will trimmed out.
$data = file_get_contents($filepath);
$data = str_replace(self::getPhpHeaders(), '', $data);
$data = str_replace(self::getPhpSuffix(), '', $data);
$data = file_get_contents($filepath);
$data = str_replace(self::getPhpHeaders(), '', $data);
$data = str_replace(self::getPhpSuffix(), '', $data);
- $data = json_decode($data, true);
+ $data = json_decode(trim($data), true);
if ($data === null) {
$errorCode = json_last_error();
$error = sprintf(
if ($data === null) {
$errorCode = json_last_error();
$error = sprintf(
*/
public static function getPhpHeaders()
{
*/
public static function getPhpHeaders()
{
- return '<?php /*'. "\n";
*/
public static function getPhpSuffix()
{
*/
public static function getPhpSuffix()
{