I’ve been developing in PHP now for 6-7 years. On the latest website I’ve been building are a few little ajax widgets for the shopping cart and such. To accomplish this, I was including a PHP file, the the ajax script was targeting a second script which includes my functions file, then includes the original file.
Today I learnt about the require_once() function in PHP. You can include your functions file wherever you like, but if it’s been called already, it gets ignored. I guess I’ve never had a need for it until now, but another one of those “d’oh” moments.






