pls help me ! how to get this value

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dreamnet
Forum Newbie
Posts: 9
Joined: Tue Mar 14, 2006 6:43 pm

pls help me ! how to get this value

Post by dreamnet »

I use json to get the value of xml with following getValue code:
$title =$json->forumid->title;
for example, if I use this code can do the output "my subject";

but since other reason ,i have to store "forumid->title" in
<input type="hidden" value="forumid->title" name="json_path" />

in my php file , I can get a varable $json_path with string value" forumid->title"

if I use $title =$json->$json_path;
will not get the output what i want "my subject", since actually, $json_path is a string rite now.

what am i going to do to get the "my subject" ?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

explode() $json_path, use references to go from there.

This feels like a bad design if you need to give pathing information.
dreamnet
Forum Newbie
Posts: 9
Joined: Tue Mar 14, 2006 6:43 pm

Post by dreamnet »

I dit explode , works, but json path is random deep, a little bit complicated;
how to say, what I am going to design is a backend control open tags search engine for xml files
that means all elements can be searched and which elements can show to public search engine depends on backend "open/close" to this elements
Post Reply