tjmbc Posted May 4, 2008 Share Posted May 4, 2008 $first_friend = "Bobby"; $relationship = " is friends with "; $first_half_of_string = "Ricky"; $second_half_of_string = " who".$relationship.$first_friend; Returns: who is friends with Bobby $full_string = $first_half_of_string.$second_half_of_string; Returns: Ricky who Why is the full string "Ricky who is friends with Bobby" not returned? The string stops at who...? Link to comment https://forums.phpfreaks.com/topic/104121-concat-not-working/ Share on other sites More sharing options...
BlueSkyIS Posted May 4, 2008 Share Posted May 4, 2008 it does for me. $first_friend = "Bobby"; $relationship = " is friends with "; $first_half_of_string = "Ricky"; $second_half_of_string = " who".$relationship.$first_friend; echo "second_half_of_string: $second_half_of_string<BR>"; $full_string = $first_half_of_string.$second_half_of_string; echo "full_string: $full_string"; output: second_half_of_string: who is friends with Bobby full_string: Ricky who is friends with Bobby Link to comment https://forums.phpfreaks.com/topic/104121-concat-not-working/#findComment-533056 Share on other sites More sharing options...
Fadion Posted May 4, 2008 Share Posted May 4, 2008 It works for me too, but why shouldnt it work anyway. And what the hell are those half a mile long variables. Link to comment https://forums.phpfreaks.com/topic/104121-concat-not-working/#findComment-533097 Share on other sites More sharing options...
AndyB Posted May 4, 2008 Share Posted May 4, 2008 And what the hell are those half a mile long variables. The OP's concept of rationally-named variables that are easy to understand when you look at code in six months' time Clearly, what's posted here produces exactly the desired result. If the OP isn't getting the same result, then likely their code is different, or not uploaded to the server, etc. Link to comment https://forums.phpfreaks.com/topic/104121-concat-not-working/#findComment-533103 Share on other sites More sharing options...
Fadion Posted May 4, 2008 Share Posted May 4, 2008 And what the hell are those half a mile long variables. The OP's concept of rationally-named variables that are easy to understand when you look at code in six months' time Thats a good practice and i usually use it, but those are exagerated on any standart Link to comment https://forums.phpfreaks.com/topic/104121-concat-not-working/#findComment-533107 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.