0

I built an application that outputs json data when a user inputs their zipcode to find out who represents them in congress. Currently the user sees json output in the browser. How can i get var_dump to render just the key value pairs without the characters into the HTML table I created?

End result: To output json string into readable text for the front-end user, like so: https://whoismyrepresentative.com/search/zip/10012

PHP https://whoismyrepresentative.com/getall_mems.php?zip='.$_GET['zip'].'&output=json'); $rep_array = json_decode($json_rep); var_dump($rep_array); ?>

HTML Table:

Your Reps
Name '.$row["title"].''; } ?>

1 Answer 1

0

since you are using php to get API results, I suggest you to use php to render results to html as well because it will save you a lot of time and considering it the performance wise using php is good in this case because you do not use AJAX to do so.. so if you get results to php script and again pass it to front end and render it using js will cost more time than just rendering it using php at this time. cause you will take it the extra mile if you use js ... so use PHP

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

Comments

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.