Hi, I have a variable and want to change it into: var.php from $var , does anyone know how to do this?
Thanks
$var="foo"; $var .=".php"; echo $var; <-- prints "foo.php"
.... or a quicker way is with the concatentation operator:
$var="foo"; echo $var.".php"; <---- also prints "foo.php"
-geoff
READ THE MANUAL before you go any further:
http://www.php.net/manual/en/language.types.string.php
Variables in double-quoted strings are parsed and expanded.