Adjusted PHP code