Skip to content
Advertisement

Category: Questions

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 …

How can I unserialize session data to an arbitrary variable in PHP?

I want to unserialize a session_encode()’d string of session data to my own array (i.e. not to $_SESSION.) There doesn’t appear to be an in-built function that handles this. There’s session_decode() but it writes directly to the $_SESSION super-global. There’s unserialize() but it returns false on session_encode()’d strings as they’re a slightly different format. What’s the best way to do

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 file, it

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 using PHP 4 for new code anyway.

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 every subdomain created to this files folder through a config file

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 PHP?

Advertisement