Question

Vincentt's avatar

Any ideas for simple, always useful PHP functions?

Asked by Vincentt (1617 points) | asked November 17th, 2007 | 4 responses | “Great Question” (0 points) | Flag as…

Hi, I’m looking for a few small PHP functions to write that might come in handy. It wouldn’t really matter if they already exist somewhere, I just need to practise this new technique but can’t think of any useful functions. Thanks in advance.

Observing members: 0 Composing members: 0

Answers

johnpowell's avatar

A regular expression to check if an e-mail address is valid. Tons of examples out there but it gets your hands dirty with a few necessary techniques.

Vincentt's avatar

Great idea John, thanks :)

iTony's avatar

there is always the login and logout. making them into function would come handy and easy to use. Sorry I am blank too :S

mlaskt's avatar

This isn’t too useful but it can save a little typing

function isPost() {
return $_SERVER[‘REQUEST_METHOD’] == ‘POST’;
}

if (isPost()) {
/* do form stuff */
}

Answer this question

Login

or

Join

to answer.
Your answer will be saved while you login or join.