Search the Community
Showing results for tags 'json array'.
-
hello, i have on row in database with this: {"Sofia":["26","42.696693","23.302080"],"Lovetch":["13","43.140461","24.718996"]} to read the data, i use : .. $datasortarray=$row_info['seats_id']; $datasortarray=json_decode($datasortarray); foreach ($datasortarray as $key=>$row){ echo $key ; } first is the name of the city, every city has an array with data - number seats, latitude, longitude Can you please tell me how to add/delete other data to this array? if i have these input fields: <input name="city" type="text"> -> city name <input name="numbers" type="text"> -> for first number.. <input name="latitude" type="text"> -> for second number <input name="longitude" type="text"> -> for third number
-
Hello, I'm trying to wrap a JSON array inside a JSON object but cannot figure out how. Here's the tutorial I'm following: In this example, you send a JSON array inside a JSON object's "data" field. Each item should have a field called "text". {"data": [{"text": "I love Titanic."}, {"text": "I hate Titanic."}]} This is my JSON array (var_dumped) string '["data",{"text":"Wrapped in my blanket always makes me feel a little better when I'm not feeling to well"},{"text":"@sportsology I know they are still far apart but I'm definitely feeling better"},{"text":"The way I'm feeling right now <<<<<"},{"text":"Sometimes my dad will sense when I'm feeling a bit shit and just give me a hug and it always makes me feel better. #appreciationtweet"},{"text":"@HayliMarie3 o no!!!!! I'm just now feeling better today!!! Suck down those emergencies!!!"},{"text'... (length=1005) This is my JSON object (var_dumped) string '"data"' (length=6) How can I go about this?