开发者

Variable won't echo in string

开发者 https://www.devze.com 2023-03-22 01:12 出处:网络
I\'m trying to echo the variable $theurl inside of $image_all but it\'s not working. $theurl = OF_DIRECTORY;

I'm trying to echo the variable $theurl inside of $image_all but it's not working.

$theurl = OF_DIRECTORY;
$image_all =  $theurl.$image_path;

This should be simple, right? It's only showing wha开发者_如何学运维t $image_path equals, even though it will echo $theurl if I simply do <?php echo $theurl; ?>.

What am I missing?


Lets make a very very simple example:

define(OF_DIRECTORY, 'blabla/test/');

$image_path = 'file.php';

$theurl = OF_DIRECTORY;
$image_all =  $theurl.$image_path;

echo $image_all;

Works great by the way! However, why use the $theurl at all? Why not $image_all = OF_DIRECTORY . $image_path;. You need provide us more information or code, but as far as your specifications goes, everything should be OKAY.

0

精彩评论

暂无评论...
验证码 换一张
取 消