Home » Posts tagged with "javascript"

While coding, many of us want to see a JSON string printed right in the browser in a readable format for easy debugging. In PHP, I usually convert the JSON string back to an Array and use print_r to print the array which throws readable output in the view-source mode. In some cases we really want to print the JSON string formatted. Use the below methods. I....
We call it Short Circuit Evaluation (also known as minimal evaluation, or McCarthy evaluation) when a programming language DOES NOT evaluate/execute the second operand in a condition. if the first operand alone can fully determine the outcome of that condition. We have been using this concept in our codes always. All PHP guys must be familiar with this...
A very basic tutorial. For the beginners who want to pass array values from PHP to Javascript for them to be accessible in the client side JS as an array. It’s really easy to pass PHP array to Javascript. The below code passes a string array in PHP to Javascript. <?php $arr = array("a","b","c"); ?> <script> var...

Page optimized by WP Minify WordPress Plugin