Notepad ortasında içerik ekleme (varolan)

0 Cevap php

Ben içeriği ile aşağıdaki bir. Txt dosyası var.

[{"key": "HR", "value": "test@gmail.com"}, {"key": "Team Leader", "value": "test1@gmail.com"}, {"key": "PM", "value": "test3@gmail.com"}, {"key": "CEO", "value": "test4@gmail.com"}]

Now ,using php if i want to add another one value like {"key": "new_emailid", "value":"test5@gmail.com"}

Çıktı bu lik olmalı

[{"key": "HR", "value": "test@gmail.com"}, {"key": "Team Leader", "value": "test1@gmail.com"}, {"key": "PM", "value": "test3@gmail.com"}, {"key": "CEO", "value": "test4@gmail.com"}, {"key": "new_emailid", "value":"test5@gmail.com"}]

In other words, how to add content inside the square bracket of the exisiting .txt file. Is it possible to insert a content in between the brackets. Please help me Thanks - Haan

0 Cevap