Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I've just taken on a job which involves coding in PHP.
I've dome a fair bit of work in ASP, but never worked in PHP before.

Is it particularly difficult or easy to pick up, and can anyone reccomend
any good online resources I can refer to for code snippets etc?


Quoted text here. Click to load it

I've stuck to PHP's procedural aspects (haven't fiddled with PHP
objects).  I've found it to be a fairly simple language with a number
of problematic exceptions.  Function naming is haphazard, for example
some functions begin with "is" and others with "is_" which is just the
kind of thing to drive one mad with frustration.  Unsetting global
arrays is another problem area.  There are more.  Function names are
not case-specific but variable names are.  That kind of thing, what
one would expect of something developed by a committee of people who
didn't get along well.  Version upgrades tend to enforce restrictions
that were never enforced before and additionally need not be enforced.
Andy Dingley once described PHP as something or other related to
Satan's piss, I don't recall his exact words but sometimes they seem

You can pick up a reasonable facility in a week or two, it'll take the
better part of a year to encounter most of the ugly bits and learn
ways around them.  But I've worked with worse languages and it's a job
and pays money (right?  gawd, I hope so!), so your suffering is on
their time. <g>

contact via


Quoted text here. Click to load it is the first place I would stop in, here is a link to their
online manual ( ) They also have
some tutorials there as well. Hope this helps some.


gripshine wrote:
Quoted text here. Click to load it

Cheers guys.

It's a site I'm taking over and giving a complete re-work. The original has
all of its active coding done in PHP and the owner has an account with a
hosting company (which offers PHP but not ASP), all bought and paid for
already which he's reluctant to switch from for obvious reasons.

I see that as a perfect opportunity to learn a new skill.


Once you get used to it you'll wonder why you ever wasted so much time
learning ASP.


On Fri, 11 May 2007 13:44:57 GMT, Fat Sam put finger to keyboard and

Quoted text here. Click to load it

PHP is easy to learn, but can be challenging to master - it has a fair
number of gotchas that are just waiting to trip up the unwary.
However, the online documentation at is generally very
good and will answer most of your questions.

Visit: - Useful stuff for the web
"Yes, I know the truth, how 'bout you?"


Mark Goodge wrote:
Quoted text here. Click to load it

Quoted text here. Click to load it


The best description of the language I've heard yet.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.


Quoted text here. Click to load it

Would you care to go into some of the gotchas that are most prominent in
your mind that people should be aware of?


Eric42 wrote:

Quoted text here. Click to load it

The register_globals setting -- is it on or off? When it's on, strange
bugs can crop up in places you don't expect; though some older code relies
on it being on.

Similar story with the magic_quotes_gpc setting.

"ol'softy" mentioned inconsistencies in function naming, giving the
example that some function names include underscores to separate out
words, such as "is_array()" and "is_null()", but others do not, such as
"isset()" (i.e. "is set").

There is also inconsistency in parameter order in search-related
functions. For example, to search for string within a larger string, you

    strstr($haystack, $needle);

but to search for an item within an array, you use:

    in_array($needle, $haystack);

Function names aren't case-sensitive, but variable names are.

The syntax of the language is very poorly designed -- perhaps because it
was never really "designed" at all -- it just fell into place. The only
fairly nice thing that can be said about PHP's syntax is that PHP isn't
Perl. ;-)

That said, just because I'm not a fan of PHP's syntax, doesn't mean that I
don't think it's overall a good language to use. PHP still has a lot of
features that I really like:

    - It's an interpreted language;

    - It's weakly typed;

    - As of PHP 5, it's got very good OO facilities;

    - It doesn't force you to *use* those OO facilities unless you
      want to (unlike, say, Java);

    - It does a lot of things for you, like parsing GET and POST
      requests and putting the submitted data into variables; and

    - It incorporates a lot of useful functionality straight into
      the language itself rather than relying on libraries.

Toby A Inkster BSc (Hons) ARCS /
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux


On Mon, 14 May 2007 12:36:05 GMT, Eric42 put finger to keyboard and

Quoted text here. Click to load it

As Toby has already said, the register_globals and magic_quotes_gpc
settings and inconsistent function naming and syntax are generally the
worst. It's very easy to get things horribly wrong if you assume one
ini setting when the reality is different, and the inconsistent naming
and syntax makes it hard to memorise all the commonly used functions -
I still have to refer to the documentation for functions that I don't
use every day, whereas I can do most things in Perl without having to
look anything up despite using the language much less often.

Also, while PHP5 does provide a very good object-oriented scripting
environment, the design of the language makes it easy to mix up
procedural and OO scripting with, again, potentially damaging results
if you don't know what you're doing.

Please give me one!
"I believe in the kingdom come, then all the colours will bleed into one"

Re: PHP says...
Quoted text here. Click to load it
It's a great language - my entire site is written in PHP. Go to
for informations.

Alfred Molon - Photos of Asia, Africa and Europe

Site Timeline