HTML mail() Sending as Plain Text
$to = "[email protected]";
$subject = "SUBJECT";
$message = "<b>MESSAGE</b>";
$headers = 'MIME-Version: …
Read Article →
52 articles about php development, tools, and best practices
$to = "[email protected]";
$subject = "SUBJECT";
$message = "<b>MESSAGE</b>";
$headers = 'MIME-Version: …
Read Article →
Below is a Mail class I created in PHP, it requires 4 arguments on initiation of the class via the constructor and uses the method ->send() to send …
Read Article →I just finished adding an export xls (excel) export feature to a web application.
I used the PHPExcel Class from CodePlex, its really great to work …!-->!-->
Read Article →I was trying to import a massive csv dataset into phpMyAdmin and it kept throwing error:
Invalid field count in csv input on line 1
This is quite …
Read Article →I think this may be the fastest way to get a list of all the directories in a given folder/directory using PHP.
$directories = …
Read Article →
In php there are a few magic constants and I find FILE to be a very useful one.
It returns the full path and filename of the file in question.
Take a …
Read Article →The default time for a php session is 1440 seconds.
You can change it by doing the following:
ini_set("session.gc_maxlifetime",1440);
You can …
Read Article →$myPath = realpath(dirname(__FILE__));
or
$myPath = getcwd();
Read Article →
This script works in all browsers, including Internet Explorer! 🙂
if (strstr($_SERVER['HTTP_USER_AGENT'],"MSIE")) { …
Read Article →
I often have to show a shortened version of a news item and then a link to show the entire news article or whatever.
Here’s a way to get that …
Read Article →$lines = file('all-words.txt');
foreach ($lines as $line_num => $line) {
echo "Line number ".$line_num;
}
Read Article →
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 →