开发者

PHP directory path using variables

开发者 https://www.devze.com 2023-02-16 16:20 出处:网络
I have the code below that should copy the fi开发者_Python百科le index.php to the directory $path=\"/data/www/vhosts/themacsplash.com/httpdocs/ClipBoy/userfiles/\";

I have the code below that should copy the fi开发者_Python百科le index.php to the directory

$path="/data/www/vhosts/themacsplash.com/httpdocs/ClipBoy/userfiles/";
$fpath="/data/www/vhosts/themacsplash.com/httpdocs/ClipBoy/userfiles/index.php";
$myFolder = $path . $myUser;
$myFolderP = &myFolder."/"."index.php";

I need $myFolderP to be set to $myFolder/index.php so e.g:

/data/www/vhosts/themacsplash.com/httpdocs/ClipBoy/userfiles/will/index.php

How would I do this? My current code for $myFolderP gives me the error:

Parse error: syntax error, unexpected '.', expecting T_PAAMAYIM_NEKUDOTAYIM in /data/www/vhosts/themacsplash.com/httpdocs/ClipBoy/code/index.php on line 94

I'm sure it's an easy fix.


You must write this

$myFolderP = $myFolder."/"."index.php";

Instead of this

$myFolderP = &myFolder."/"."index.php";
0

精彩评论

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