Check for arr. Also remove end php item