N
N
nashivancom2021-04-23 18:07:41
PHP
nashivancom, 2021-04-23 18:07:41

How to get data from xml and insert it into a list?

There is a link on which cities are registered in xml format:
image.png

How can I substitute these values ​​in a template in a regular list?

<select>
    <option value="Город1">Город1</option>
    <option value="Город2">Город2</option>
</select>

I understand that you need to loop over the option tag and iterate over all the values. But how can you get them from this link? This is the first time I've encountered this, can you guide me please.

I am using laravel.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2021-04-23
@nashivancom

ok google –> php parse xml.
believe it or not, there are 100,500 options for that.
and laravel here only on the side.

N
nokimaro, 2021-04-23
@nokimaro

https://www.php.net/manual/ru/simplexml.examples-b...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question