Debugging with PHP

In this article, we look at various ways of debugging PHP scripts, from printing variable values to using sophisticated debuggers.

Parsing JSON with PHP

The function `json_decode()` can be used to convert JSON data to PHP variables. Arrays as well as objects can be converted to their equivalent PHP literals.

Preventing SQL Injection in PHP

This technique of attacking data-driven applications by injection of malicious SQL code is known as SQL Injection. Well-written applications that employ proper checks can easily defend themselves against this type of attacks. Here are some ways in which apps written in PHP can check for SQL Injection attacks.

Passing variables between pages with PHP

Since HTTP is stateless, webpages are disconnected and this implies that Page A won’t be aware of the existence of Page B or any data thereof. However, Page A can still access the variables from Page B scripts using the methods discussed here.