I am used to use format 1, but I found a php standard document said that my code is not standard . but not tell why format 2 is better than format 1. any one tell me why?
Bro, to be honest its entirely up to you. The pear framework uses it the second way. The majority of the others use the first.
Conventions don't necessary have a valid reason and logic they are just the standard practice so that when you use other libraries you are adapting the same as they are