Skip to content

Instantly share code, notes, and snippets.

@aalipar13
Created July 3, 2019 02:30
Show Gist options
  • Save aalipar13/bf34782141ebb97c98ff1fc4f5024ae2 to your computer and use it in GitHub Desktop.
Save aalipar13/bf34782141ebb97c98ff1fc4f5024ae2 to your computer and use it in GitHub Desktop.
<?php
$json = file_get_contents('json.txt');;
$array = json_decode($json, true);
$newArray = [];
foreach ($array as $value)
{
$value['provDesc'] = ucwords(strtolower($value['provDesc']));
$newArray[] = $value;
}
// echo json_encode($newArray);
file_put_contents('province.txt', var_export($newArray, true));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment