Delete from json using php

前端 未结 6 803
不思量自难忘°
不思量自难忘° 2020-12-30 18:32

my Current json code :

{\"Results\":[{\"username\":\"test\",\"password\":\"test\"},{\"username\":\"test\",\"password\":\"test\"},{\"username\":\"google\",\"p         


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-30 18:59

    Old question, formatting your JSON differently would help a lot. Each result entry should have a unique key to identify it. This makes it easy when needing to remove or update that result. No reason to iterate over entire JSON this way.

    Code would look like this

    ?>

提交回复
热议问题