I need to be able to include a variable to the url so when i use file_get_html i can get to the specific page i need.
Here is what i am trying as a test.
$activity= 'com.google.com';
$html = file_get_html("https://play.google.com/store/apps/details?id=".$activity) or die('this is not a valid url');
echo $html;
The activity is what will change when running my mysql_fetch_array. I have tried single quotes, double quotes no quotes and cannot come up with a solution.
I just get this is not a valid url
If i use this, it works because its replacing just the base url
$a = 'google.com';
$b = "http://" . $a . "/";
$html = file_get_html($b)
It seems to only be an issue when accessing a specific url
UPDATE The above wasn't working because it was not a valid url. when entering a valid url, it work.
However, putting in my real world scenario it says not a valid url
$html = file_get_html("https://play.google.com/store/apps/details?id=".$row['activity']) or die('this is not a valid url');
....id=".urlencode($activity) .... That way characters in query variables will not be able to break / invalidate your url.