jaxdevil Posted June 7, 2008 Share Posted June 7, 2008 I know this one I just can't remember it. How do I make this: $FinalCat = '$SubSubCat|$SubSubSubCat'; Display the actual variable with a | and then the other variable. I.e. if the variable $SubSubCat means 'hello' and $SubSubSubCat means 'goodbye' then I want to make $FinalCat mean 'hello|goodbye' How do I accomplish this? Thanks in advance guys! SK Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted June 7, 2008 Share Posted June 7, 2008 Couple of different approaches: echo $foo.'|'.$bar; //or: echo "$foo|$bar"; Basically, variables inside single quotes are not parsed. That is, if you echo this: echo '$var'; Then all that will be displayed is $var. However, they are parsed (and therefore their value is displayed) if inside double quotes. So you either place them inside double quotes or use no quotes at all and concatenate. Quote Link to comment Share on other sites More sharing options...
Lefteris Posted June 7, 2008 Share Posted June 7, 2008 That's easy All you gotta do is type: $FinalCat = $subsubcat."|".$subsubsubcat Edit: Damn! Was slow Quote Link to comment Share on other sites More sharing options...
jaxdevil Posted June 7, 2008 Author Share Posted June 7, 2008 Thanks guys. Thats what I was forgetting. Cheers! SK Quote Link to comment 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.