changed building json from associative array in php