Using Wp_Query, Json to add Highcharts series data
If it’s just a simple tweak to the output string then just use str_replace. $averagePricejson = “[[0,0],[1,39000],[2,62500],[3,80000]]”; $averagePricejson = str_replace( “]]”, “],]”, $averagePricejson); echo $averagePricejson; // [[0,0],[1,39000],[2,62500],[3,80000],]