Reputation: 0
Neutral
- Group:
- Members
- Active Posts:
- 28 (0.02 per day)
- Most Active In:
- PHP (11 posts)
- Joined:
- 12-March 10
- Profile Views:
- 1675
- Last Active:
Oct 07 2012 08:08 PM- Currently:
- Offline
My Information
- Age:
- 24 years old
- Birthday:
- May 29, 1988
- Gender:
-
Not Telling
- Expertise:
-
HTML
CSS
PHP
Javascript
SQL
Flash
Contact Information
- E-mail:
- Private
Posts I've Made
-
In Topic: JSON Decode Trouble
05 October 2012 - 03:42 PM
soulcyon, on 05 October 2012 - 02:06 PM, said:
http://jsonlint.com/ is my best friend, and he says you are missing the last "}"
If you want to decode Json string to PHP, you should try usingjson_decode($string, true)
. the STD-Class comes because the "true" flag is not set on json_decode
Here's a sample:
$data = json_decode('{"test" : "WAZAA"}', true); echo $data["test"]; // echos out WAZAA
Ok. I was missing one "}" Thx for that.
I have something like this in my class to read
public $archivo = ""; public $archivoJson = ""; public $json; /* Carga los datos del JSON a la clase */ function class_JSON($archivo_abrir) { try{ //Se guarda el archivo $this->archivo = $archivo_abrir; //Se lee el archivo $conexionArchivoJson = fopen($this->archivo, 'r'); $this->archivoJson =fread($conexionArchivoJson,filesize($this->archivo)); fclose($conexionArchivoJson); $this->json = json_decode($this->archivoJson); }catch(Exception $e){ } }
Now I need to read everything else. I want to manipulate that structure. I cant do it now :/
Do you have any idea to manipulate the child nodes?? names, id, values?
Friends
pakbron hasn't added any friends yet.






Cartoon Clouds
Mountains
Sunrise
Clouds
Green Clouds
None
Find My Content
Display name history

Help
Comments
pakbron has no profile comments yet. Why not say hello?