I am trying to combine some php variables to get the full path to a file.
$filepath and $file are working variables. I want the combined variable to be like > filepath/file.xml
$get = file_get_contents( $filepath '/' $file '.xml');
this is what I have and does not work.
Add concatenate of both $filepath
and $file
$get = file_get_contents( $filepath.'/'.$file.'.xml');
Use this code:
You are missing .
for concatenate.
$get = file_get_contents( $filepath.'/'.$file.'.xml');
if you want to combine the path, don't forget using predefined constants DIRECTORY_SEPARATOR (slash or back slash according with your system) and concatenate it with "."
$DS = DIRECTORY_SEPARATOR;
$get = file_get_contents( $filepath.$DS.$file.'.xml');