1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 21:34:03 +00:00
laravel-tips/content/tips/you-can-check-if-a-string-contains-json-by-decoding-it-encoding-it-again-and-comparing-the-value-with-the-original.md
2021-10-29 21:16:27 +02:00

586 B

title tweet_id thread_slug author_username images created_at slug
You can check if a string contains JSON by decoding it, encoding it again, and comparing the value with the original 1454133800888410119 weekly-thread-2021-43 freekmurze
https://pbs.twimg.com/media/FC4Bs0lXEA4WV-P.jpg
2021-10-29T17:11:29+00:00 you-can-check-if-a-string-contains-json-by-decoding-it-encoding-it-again-and-comparing-the-value-with-the-original

🔥 A way to check if a string contains valid JSON: just decode it, encode it again, and check if it matches the original value #php