K
K
khodos_dmitry2018-03-06 12:58:22
PHP
khodos_dmitry, 2018-03-06 12:58:22

How to get an absolute link from a relative one when parsing?

I am using phpQuery. Maybe there is something in it? I can use something else.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Sisin, 2018-03-07
@JabbaHotep

I don't write in PHP myself, so I googled it and was quite surprised that I couldn't find anything other than this:
https://github.com/monkeysuffrage/phpuri
Alternatively, you can write the function yourself

O
orte0, 2018-04-04
@orte0

After all, you are parsing a certain url with a curl, or no matter what. It should contain some kind of "$_SERVER['HTTP_HOST']", i.e. the domain. This is the missing part of the url. You can glue it in this order: http://(host)/(your relative url).
But maybe I misunderstood your question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question