I am trying to join several variables to create a file path. The file path changes each day and have set it up accordingly. The problem is that after I join them together they they delete them self and leave only the date. Here is the code
$filepath2 = "/data/";
$date = date(Ymd);
$unit = $_GET;
$part1 = strval($unit);
$part2 = strval($date);
$part3 = ".txt";
$filepath = $filepath2 + $part1 + $part2 + $part3;
echo $filepath;
The echo just comes back with 20120713 (the date). Where have I gone wrong?
date("Ymd")instead of w/o quotes?string date ( string $format [, int $timestamp = time() ] ). Meaning, the first parameter needs to be a string. Link: php.net/manual/en/function.date.php