I don't like to use phalanx armies very much but here is a pretty effective one.
__________HHH_______HHHH
C_______H______IIII_______H______________________________CC
____________A___G___A_A____________C
H=hoplite
I=Infantry (ussually mercs)
A=archers
C=cavalry
G=general
Basically the AI will ussually assault the right phalanx formation (i like to put heavier units there like spartans :wink: ), or if they have enough infantry both. You can wheel the left hoplites around if they only attack one or fill the gaps with your standard infantry. Cavalry is used for elimnating enemy cav or hitting the back sides. The AI will often move spearmen towrds the cav, which will lighten the load on you infantry. The farther out your wing is, the more room you have to out-manuever any spearmen. This also works good for attacking as well.