Completed p1 in PHP