How to export Json file from phpAdmin without COMMENTS (// ..... * /)

I have a .json file exported using phpAdmin tool. My problem is that the json is not valid ... I am asking how is it possible that Phpadmin is exporting a Json file that is not valid? The comments in my file are the biggest problem. Please help me because when I attach this .json they tell me this json is Invalid. And Firebase cannot use that.

+3


source to share


1 answer


You can't seem to ignore the generation of JSON comments, if you have access to the phpMyAdmin source code on your server, you can easily remove the generation of comments in the file

PhpMyAdmin / libraries / plugins / export / ExportJson.php



see the function exportHeader

and for other comments just search the file for //

(it doesn't take that long).

If you don't have access to the phpMyAdmin source code, you can delete comments after creating the file (either manually or using a program on your computer if you need it one or more times). You can use two regex for this, if you need more help I can post an example.

+1


source







All Articles