Checking strings in PHP for JSON output

A. I store tags in a database that are user defined.

B. For submissions, a group of these tags is then retrieved with the query and concatenated.

C. I repeated this format and printed each tag in the view.

For part B, I create a JSON array with concatenation in the request. But now I think it would be worth choosing a lighter format than JSON. My reasoning is to simplify the validation of user tags entering the database.

If I were to select one separator, tell me ,, in order to identify tokens, the only check would be to prohibit this symbol for tags?

+3
source share
1

, , JSON.

? JSON , , json_decode PHP eval JSON.parse Javascript, JSON , . JSON.

+2

All Articles