Skip to content

PEAR Mail_Queue sending duplicate emails

Here are a couple of questions: Is mail_queue->put supposed to insert a message twice in the database? The only differences are the time_to_send value and the user_id. This is what I get for a …

Detect file encoding in PHP

I have a script which combines a number of files into one, and it breaks when one of the files has UTF8 encoding. I figure that I should be using the utf8_decode() function when reading the files, but I don’t know how to tell which need decoding. My code is basically: Currently, at the start of a UTF8 f…

Are php strings immutable?

Or: Should I optimize my string-operations in PHP? I tried to ask PHP’s manual about it, but I didn’t get any hints to anything. Answer PHP already optimises it – variables are assigned using copy-on-write, and objects are passed by reference. In PHP 4 it doesn’t, but nobody should be …

Application access server load

I have developed an application in PHP + JavaScript. I’m using MySQL as database support. Every account for this app will come with a subdomain… so the client Stardust would have stardust.mysite.com. I want to put the application files in a folder outside public_html and link every account from ev…

What is the function __construct used for?

I have been noticing __construct a lot with classes. I did a little reading and surfing the web, but I couldn’t find an explanation I could understand. I am just beginning with OOP. I was wondering if someone could give me a general idea of what it is, and then a simple example of how it is used with PH…