$myText = (string)$myVar; There are more details for string casting and conversion in the Strings section of the PHP manual, including special handling for booleans and nulls.
Simply using include() or require() to output the contents of a ‘include’ file on another web page may work perfectly 90% of the time. However, there will be times where you may want to save it into a variable instead – especially if you are using PHP template classes to generate your web pages. Anyone …
A question I often get is this: how can I make multiple variables into one? The problem is, you put them together, you go to call the variable, but instead of acting like a variable it acts like text. Here is one of the examples sent to me.
variable creation into one line