Skip to content

Which line break in php mail header, rn or n?

I’ve seen a lot of examples using the php mail function. Some of them use rn as line break for the header, some use n. $headers = “From: Just Men”; $headers .= “Reply-To: Just me …

More efficient query in mysql

I want to know how do they do a query with only one textbox in the page, but the current text in the text box can be used as a parameter for the query. I’m currently using the query below but I don’t …

PHP: how can I get file creation date?

I am reading a folder with lots of files. How can I get the creation date of a file. I don’t see any direct function to get it. There are filemtime and filectime. And if the file hasn’t been modified, what will happen? Answer Use filectime. For Windows it will return the creation time, and for Uni…

control file to PHP array

In Linux, .DEB files have ‘control’ text files that are arranged as follows: What is the best way to get the control file into a PHP array resembling: keeping in mind that the values can be multi-line and include the “:” separator. Thanks! Answer Implemented as described here: http://w…

Convert this array to an HTML List

I have this array: OR Every key is the id and value is the id for the childs of this parent. ID of 0 means that (3 & 6) have no parent. Now, i want to output an HTML list like: 3 4 7 8 9 5 6 Answer Test it. or

PHP PDO: charset, set names?

I had this previously in my normal mysql_* connection: Do I need it for the PDO? And where should I have it? Answer You’ll have it in your connection string like: HOWEVER, prior to PHP 5.3.6, the charset option was ignored. If you’re running an older version of PHP, you must do it like this: