Search
 
SCRIPT & CODE EXAMPLE
 

PHP

json data wdit in php

$data[0]['activity_name'] = "TENNIS";
// or if you want to change all entries with activity_code "1"
foreach ($data as $key => $entry) {
    if ($entry['activity_code'] == '1') {
        $data[$key]['activity_name'] = "TENNIS";
    }
}

$newJsonString = json_encode($data);
file_put_contents('jsonFile.json', $newJsonString);
Comment

PREVIOUS NEXT
Code Example
Php :: export laravel path fedora 
Php :: elvis operator php 
Php :: php glob multiple file with different formats in directory 
Php :: Deprecated: Implicit conversion from float 
Php :: php sdk paytm 
Php :: Get a link to a record or page in any language version (Polylang) 
Php :: what is laravel framework 
Php :: register style wordpress 
Php :: wordpress page template comment 
Php :: php artisan tinker get records 
Php :: undefined offset: 7 in d:xamphtdocsphpfunctionfunction.php on line 137 
Php :: layer order matplotlib 
Php :: laravel how to address to git repo for develop packages 
Php :: nwidart/laravel-modules seed 
Php :: laravel create event listener 
Php :: php server on local machine 
Php :: php is multiple of 
Php :: pregmatch 
Php :: Laravel Exclude URI from csrf token verification 
Php :: display rounded price get_price php 
Php :: php send sms for aws sns sdk 2 
Php :: header file same but page title are different in php 
Php :: how to fetch google reviews and data in php URl 
Php :: registration form in php and mysql 
Php :: php random array name 
Php :: Integrity constraint violation laravel socialite google login 
Php :: laravel make model controller migration -mcr 
Php :: php 8.0 linux 
Php :: php undefined array key 
Php :: laravel attribute event 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =