Convert HTML + CSS to PDF with PHP?

Ok, I'm now banging my head against a brick wall with this one. I have an HTML (not XHTML) document that renders fine in Firefox 3 and IE 7. It uses fairly basic CSS to [...]

Delete an element from an array

Is there an easy way to delete an element from a PHP array, such that foreach ($array) no longer includes that element? I thought that setting it to null would do it, but [...]

PHP detecting request type (GET, POST, PUT or DELETE)

How can I detect which request type was used(GET, POST, PUT or DELETE) in php? Source: Stackoverflow [...]

How do I implement basic “Long Polling”? [closed]

I can find lots of information on how Long Polling works (For example, this, and this), but no simple examples of how to implement this in code. All I can find is cometd, [...]

UTF-8 all the way through

I'm setting up a new server, and want to support UTF-8 fully in my web application. I have tried in the past on existing servers and always seem to end up having to fall back [...]

PHP and Enumerations

I know that PHP doesn't have native Enumerations. But I have become accustomed to them from the Java world. I would love to use enums as a way to give predefined values which [...]

Using a regular expression to validate an email address

Over the years I have slowly developed a regular expression that validates MOST email addresses correctly, assuming they don't use an IP address as the server part. I use it [...]

When to use self over $this?

In PHP 5, what is the difference between using self and $this? When is each appropriate? Source: Stackoverflow [...]

What’s the best method for sanitizing user input with PHP?

Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of html tags? Source: [...]

How can I prevent SQL-injection in PHP?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = [...]