I make a request to the API, in return I get an xml-file, encode it in json, decode it into an array:
$xml = simplexml_load_string($response); $json = json_encode($xml); $array = json_decode($json, true); But there is one nuance. In one of the xml tags there is the following text:
<conditions> <ul><li>Цены на авиабилеты указаны с учетом топливных, аэропортовых и государственных сборов.</li><li>Количество авиабилетов на каждом рейсе по данному тарифу ограничено.</li><li>Курс расчета и цена в рублях могут меняться без предварительного уведомления.</li></ul> </conditions> As a result, if I decode such a string into an array and try to output it via var_dump, then <ul><li> tags also get into the output. Is this normal, if they are stored as a value in an array, or are they better removed (if so, how)?
то в вывод попадают и теги <ul><li>. Tags get as array keys, which is expected. - E_p