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

Keine Trackbacks

Kommentare

Ansicht der Kommentare: Linear | Verschachtelt

Noch keine Kommentare

Kommentar schreiben

Die angegebene E-Mail-Adresse wird nicht dargestellt, sondern nur für eventuelle Benachrichtigungen verwendet.
Um einen Kommentar hinterlassen zu können, erhalten Sie nach dem Kommentieren eine E-Mail mit Aktivierungslink an ihre angegebene Adresse.

Um maschinelle und automatische Übertragung von Spamkommentaren zu verhindern, bitte die Zeichenfolge im dargestellten Bild in der Eingabemaske eintragen. Nur wenn die Zeichenfolge richtig eingegeben wurde, kann der Kommentar angenommen werden. Bitte beachten Sie, dass Ihr Browser Cookies unterstützen muss, um dieses Verfahren anzuwenden.
CAPTCHA

Markdown-Formatierung erlaubt
Formular-Optionen