unknown1 Posted April 8, 2013 Share Posted April 8, 2013 (edited) 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'); Edited April 8, 2013 by unknown1 Quote 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... Quote 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 (edited) 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. Edited April 8, 2013 by unknown1 Quote 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. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/276674-help-with-php-concatenating/#findComment-1423498 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.