Home >Backend Development >PHP Problem >Is it possible to delete json in php?

Is it possible to delete json in php?

藏色散人
藏色散人Original
2021-11-26 09:48:392846browse

php can delete json. The method is: 1. Create a PHP sample file; 2. Get json data; 3. Delete the specified json through "unset($data['10073']);" Just data.

Is it possible to delete json in php?

#The operating environment of this article: Windows7 system, PHP7.1, Dell G3.

php Is it possible to delete json?

Is it possible to delete json in php?

#I want to delete the data in the red box through commands, how to do it?

The code is as follows:

<?php
$json_data = &#39;{....}&#39;;
$data = json_decode($json_data, true);
unset($data[&#39;10073&#39;]);
var_dump($data);

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of Is it possible to delete json in php?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn