From ThorstensHome
Revision as of 16:38, 12 December 2015 by ThorstenStaerk (Talk | contribs)

Jump to: navigation, search



It happens often that I see an empty page where I would expect something. One example is when I migrate a server and have a php script running on a new server. It may turn out that this new server does not have a specific PHP module and that is why it does not work. Similarly, if I forget a ";" at the end of a command, the whole php file will just show nothing in the browser.


Here is a php trick that outputs debugging output when you want.

fwrite ($handler, "hello world");
fclose ($handler);

example for variables:

fwrite ($handler, var_export($variable,true));
fclose ($handler);

variables' content


To output an array use

echo serialize($array)

magic words