Php readandsave fixed