Awesome q2a theme

What a unique symbol to use to explode?

0 like 0 dislike
28 views
I connect to a string data I need using the delimiter ";"
$getJson = sprintf("%s;%s, $var, $var2);

Then get:
explode(';', $getJson);

And there is a problem that in $var2 can be any text and if found the symbol ";" , break wrong.
What you can come up with such a unique character (or character set) that just will not use in the text? Or how to solve this?
by | 28 views

2 Answers

0 like 0 dislike
No, just work with JSON as JSON, and not to fence a Bicycle.
$json = json_encode([$var, $var2]); $array = json_decode($json);
by
0 like 0 dislike
'?' - if the string does not contain questions
or a double colon "::", but if there can be ip addresses, then that expression will not work.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked May 3, 2019 by angelok_adclan_2017
0 like 0 dislike
3 answers
110,608 questions
257,187 answers
0 comments
40,796 users