PHP is often regarded to as an easy web programming language/environment with a fast learning curve. Perhaps, this is mainly due to the following reasons. Read more...
Posts tagged with: php
Some of PHP’s built-in functions can be quite handy. One of these is
which transforms newlines (
\n and other variants)
into HTML line breaks (
<br>) — more precisely, it puts
<br> before each newline.
It has been used, and sometimes is still used, when echoing a CLOB on a webpage.
Actually, this function is no longer necessary: with the CSS property
white-space you can do the same on the client-side in a
neat and efficient way. However, this post is just an example on how to create
something resembling PHP’s built-in functions using the instruments of
Java EE. Read more...
If you run a linux system with the Apache web server and PHP, you may want to shutdown the system from within a PHP script.
The obvious idea is to call
system("shutdown -h now") from PHP, but
it will not work if Apache is run by an unprivileged user (actually, it should).
Here is my solution, merging various sources from the Internet. I find it the cleanest one. Read more...