unknown1 Posted April 8, 2013 Share Posted April 8, 2013 Need help with php concatenating. $page = array('1','2','3','4','5','6','7','8','9','10','11','12', '13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30'); $city = array('ACTON','ADELANTO','AGOURA HILLS','ALAMEDA','ALAMO','ALBANY','ALHAMBRA','ALISO VIEJO'); // the code below invalid...and I can't seem to write it so it will work. Any ideas? //if you can't see the issue...it's because of the ".$city.". I know it should be ".$city." but it's suppose to be a sub-domain and with the //extra dot it gives off an error. $html = file_get_html('http://".$city.".somesite.com/buy-and-sell-Page".$pg."ZZisCitySearchtrue'); Link to comment https://forums.phpfreaks.com/topic/276674-help-with-php-concatenating/ Share on other sites More sharing options...
subhomoy Posted April 8, 2013 Share Posted April 8, 2013 try this one $html = file_get_html("http://".$city."somesite.com/buy-and-sell-Page".$pg."ZZisCitySearchtrue"); yu don't need single innerted comma to concat.. Use " " this instead... If u use ' ' then it echo out as it is without evaluating the php code... Comment if u need any help... Link to comment https://forums.phpfreaks.com/topic/276674-help-with-php-concatenating/#findComment-1423491 Share on other sites More sharing options...
unknown1 Posted April 8, 2013 Author Share Posted April 8, 2013 try this one $html = file_get_html("http://".$city."somesite.com/buy-and-sell-Page".$pg."ZZisCitySearchtrue"); yu don't need single innerted comma to concat.. Use " " this instead... If u use ' ' then it echo out as it is without evaluating the php code... Comment if u need any help... $html = file_get_html("http://".$city."somesite.com/buy-and-sell-Page".$pg."ZZisCitySearchtrue"); // doesn't work because it should be a sub domain like $html = file_get_html("http://".$city.".somesite.com/buy-and-sell-Page".$pg."ZZisCitySearchtrue"); //but because of the extra . in the sub domain it produces an error. Link to comment https://forums.phpfreaks.com/topic/276674-help-with-php-concatenating/#findComment-1423494 Share on other sites More sharing options...
unknown1 Posted April 8, 2013 Author Share Posted April 8, 2013 But Thanks!! I thought I tried it like $html = file_get_html("http://".$city.".somesite.com/buy-and-sell-Page".$pg."ZZisCitySearchtrue"); already... $html = file_get_html("http://".$city."somesite.com/buy-and-sell-Page".$pg."ZZisCitySearchtrue"); // doesn't work because it should be a sub domain like $html = file_get_html("http://".$city.".somesite.com/buy-and-sell-Page".$pg."ZZisCitySearchtrue"); //but because of the extra . in the sub domain it produces an error. Link to comment https://forums.phpfreaks.com/topic/276674-help-with-php-concatenating/#findComment-1423495 Share on other sites More sharing options...
salathe Posted April 8, 2013 Share Posted April 8, 2013 Is the URL supposed to be http://ACTON.somesite.com/buy-and-sell-Page1ZZisCitySearchtrue ? That seems odd with the ZZ… part, which is why I'd like to check with you. Link to comment https://forums.phpfreaks.com/topic/276674-help-with-php-concatenating/#findComment-1423498 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.