PHP

61 articles about php development, tools, and best practices

Force Download in PHP

This script works in all browsers, including Internet Explorer! 🙂

Sometimes you need to force the browser to download a file instead of displaying it …

Read Article →

PHP – file() lines

Need to read a file line by line in PHP? The file() function is the quickest way to do it. It reads the entire file into an array where each element …

Read Article →

Send Email PHP Function

Ever find yourself typing the headers into the php mail() function over and over again?

Try using a standard function and calling it when you need to …

Read Article →

htaccess ErrorDocument

Create a file called .htaccess in the root of your public_html/htdocs of your domain.

This is useful when you want to handle error pages gracefully …

Read Article →