Example:
I have this HTML Code
Wanted:
I want to insert above code into JSON using PHP .. ?
Question:
How to do it … ?
Solution:
We can make like code below:
Explain:
- All atribute inside HTML prefer quoted with single quote
- JSON_UNESCAPED_SLASHES mean do not escape /
Result:
The JSON data type is string and the result is:
Thanks For Reading