Debugging Techniques
1) echo $var; – use echo to print the variable so that you can confirm the value in that variable. You can use this in POST/GET handling to confirm whether the script has expected value in POST/GET.
2) var_dump ($var); – var_dump is useful while dealing with arrays and objects. It displays their complete structure so that you can check if the array or object has the correct value.
3) die (“value in var: $var”); – die will end the script after printing the message. You can use this anywhere in your script while debugging.
Always remember to remove your debugging code once you are done with it. To know more about it, visit our website.














