Skip to content

web - tips and tricks about php filehandling and handling json files

While developing an example for the heartbeat component, i run into problems dealing with file handling in php. The problem comes from race conditions by reading and writing (updating) the same files. I must admit, it still needs some time to solve this problem in a sufficient way, but i'm on it.
Nevertheless, two shiny links where found by my preferred search engine and it would be a shame to not share them.

The first link has the title handling json like a boss in php. The page shows you how to encode and decode json files in php. What i liked very much, it also contains an error handling part. Shame on my side, i was not aware of the json_last_error function, now i am :-).

The second link headlines itself PHP File-handling tips and tricks and it contains a lot. I like, that the author puts back the SPLFileObject and SPLFileInfo into the limelight.
Even better, i wasn't aware of the available stream "php://temp". Thank you both!

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Markdown format allowed
Form options