The phalanx formation first appeared around 25th century BC from the Sumerians. It was the basic form of the phalanx showing men called hoplites together holding spears and large shields called the hoplon.
Earlier on 7 - 6 BC the Greeks used the phalanx formation. They had mix theories from where it started. Some historians said that came from ancient Sparta but later they have discovered that the word "hoplon" (shield) was originate from the Greek city of Argos.
The most known , major victory with the phalanx formation was with the Athenians at the battle of Marathon that the Greek hoplites defeated the Persian army around 490 BC and it was the first major defeat against the Persian empire, with thousands of dead Persian soldiers and the Greeks to suffer only with just few casualties.
Another great battle that remained in history was the battle at Thermopylae that King Leonidas and his 300 hoplites fell while they resisted thousands of Persians and hold their phalanx formation for many continues waves.
Alexander the Great used his Macedonian phalanx (sarissa) to conquer all the known world and defeated the Persians once and for all.
Many other nations adopted the Greek phalanx like the Carhidonians, the Seleucid Empire the Egyptians etc .
Individuals within the Phalanx would be armed with a large shield also called the "hoplon", a six to nine foot spear and a short sword (xiphos). The Phalanx structure allowed for unparalleled defense for the era, and the superiority of phalanx formation was only eclipsed by the invention of firearms.
Phalanx weakness are the flanks therefore the phalanx formation was always deployed near bridges or between two hills or mountains that it was hard to for the enemy to hit the flanks or even attack from behind.
The phalanx unit is generally seen in historic strategy games within the bronze age like Rome: Total War that uses various units with the above formation. Typically the defense score of the unit is twice to three times as large as the attack attribute.