Ramazan
Regular Member
- Aug 19, 2018
- 433
- 308
I have data something like that https://prnt.sc/1b21psb I'm inserting that data with python to mysql and showing on panel with PHP how can I clean those tags?
Depends on how have the tags. You have it inside an array that you are putting through json_encode? If so, try the json_encode like this:I have data something like that https://prnt.sc/1b21psb I'm inserting that data with python to mysql and showing on panel with PHP how can I clean those tags?
echo json_encode($data, JSON_PRETTY_PRINT);
echo json_encode(json_decode($data, true), JSON_PRETTY_PRINT);
Nothing is changed https://prnt.sc/1b27tre but I wrote a small function for cleaning tags. Next time I have to go deeper thanks for your effortDepends on how have the tags. You have it inside an array that you are putting through json_encode? If so, try the json_encode like this:
Code:echo json_encode($data, JSON_PRETTY_PRINT);
If you have raw json that you are echoing, try:
Code:echo json_encode(json_decoe($data, true), JSON_PRETTY_PRINT);
Untested code. If you get error, please reply with the message.
function tagcleaner($data)
{
$data = str_replace("[[", "", $data);
$data = str_replace("[", "", $data);
$data = str_replace("]]", "", $data);
$data = str_replace('""', "", $data);
$data = str_replace('"', "", $data);
return $data;
}