I used to be a "Ask questions first" type of guy but ever since going into "Read first" mode I've found myself learning about 100x as much and actually remember much of it!
By sifting through the manual, one will stumble upon other useful functions. For example, I remember when I looked up "sprintf" I went through other string related functions and found "ucwords" , which was something I needed for a project and I feared I'd have to do RegEx for it (I was really really scared of Regular Expressions but now I am just scared 😉 BTW, the RegEx Article here is WONDERFUL.
Point is, once one starts reading the manual the learning really sets in. Still, reading and rereading basic PHP tutorials is a good start and allows the manual to stick to your brain. Reading the manual helps PHP Articles (like on phpbuilder) make sense.
If you're stuck, here's what you could do :
- Search manual (especially if you need help with a function!)
- Search php forums and mailing lists
- Search google (adding the term PHP helps)
- Post question with educated thoughts and some detail on what you want to do and what you tried to do.
Doing searches you WILL find other useful information and with any luck, most likely find the answer to your question. And if not, don't hesitate to post to the forum, people love to help. In fact, many answers you see here are a result of a little research , not straight out of the brain. And guess who learns the most during this process? Yes you guessed it, the researcher.
If you're looking up a function in the manual, READ THE ANNOTATIONS IN THE MANUAL. When you do a search on PHP.net and see the results, annotated links don't have the html dir in it. So :
php.net/manual/function.TERM.php = annotated
php.net/manual/html/function.TERM.php = not annotated
BTW, you can search the php manual like this :
php.net/TERM
and it automagically does a search for that TERM (one of the most useful 404 pages I've seen)
And remember, don't just read the examples, replicate/modify/break/do them and see what happens. This is very important. Yeah, reading what a function looks like is one thing but can you create your own? Test yourself.
So, those are some thoughts from a struggling non-CS person learning and loving PHP. I actually am working on a PHP metasearch support tool that hopefully will be public soon, will keep you posted.
And remember, NOBODY has memorized the PHP Manual and NOBODY has all the answers.
Philip