0

I am (trying) to build a web app, first one :) I need to call a JSON object though, and I am using a simple search form to get a word that I will append to the call, but I need PHP to handle the object when it is returned. How can I do this? Basically I had the form submit calling a function that, ideally, would go get the object and do what it needs to, then return the results formatted how I want. Does that make sense even? Thank you!

2
  • So you are having the form go get some data formatted as JSON and then act on that data? Sry, confused by question Commented Aug 9, 2010 at 0:42
  • I need the form just to get the user search string so I can call a JSON object. But when it is returned, I need it to be handled by my PHP function. So I was seeing if there is a way to pass the string into PHP, and then call the JSON object from within the PHP function...? Commented Aug 9, 2010 at 0:54

1 Answer 1

3

PHP 5.x has some built in functions: json_decode() and json_encode(). They are worth looking into and should answer your question. If you have less then PHP 5.x the user comments at both of those pages should have alternatives to use in it's place.

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah saw this :) I am going to read those now, do they do what I am looking for? I have never used those functions before..
Read through them to determine. But yes, they should do what you described both in the question and the comment you posted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.