0

I have big problem with file_get_contents. When I do for example:

   $url=2
   $linkk = '.'.$this->address.'/'.$url.'.';
   $result = file_get_html($link)

WHERE url is changable number and $this->adress is a hyperlink. When I do echo $linkk and then paste it in browser it works correct!

What can be reason of this problem?

3
  • 1
    Uhm... $linkk vs. $link? BTW, you do not describe what your "problem" is.
    – deceze
    Feb 25, 2012 at 23:28
  • $link and $linkk are not the same variable.
    – vichle
    Feb 25, 2012 at 23:30
  • 1
    where is file_get_contents? Show the source of file_get_html Feb 25, 2012 at 23:38

2 Answers 2

2

Unless this is a transcription typo, your variable is called $linkk (two k's), and your are calling file_get_html() with $link (one k).

2
  • I did mistake in paste code, but for my example it is correct anserw(so i accepted it). My real problem was that i don' t do html_entity_decode and in my hyperlink i had & so in code i had ;amp. Thanks for help
    – kolek
    Feb 26, 2012 at 22:56
  • @kolek: If this answer isn’t right, don’t accept it; post the actual solution as a self-answer.
    – Ry-
    Mar 7, 2013 at 2:07
1

This extra k is causing the problem.

   $url=2
   $link = '.'.$this->address.'/'.$url.'.';
   $result = file_get_html($link);

If you still get problem then its the file_get_html function.

Not the answer you're looking for? Browse other questions tagged or ask your own question.