I have 2 variables - $imgs which holds the name of an image, and $ex which is the image extension.
I am trying to echo the image.
I am facing a syntax error.
echo '<div align = "center"><img src ="'.$imgs.'"."'.$ex" /></div>';
On
You're messing the " ' with the . First of all:Try to write with some style! For example every time when I have to concatenate something I`m using the empty space for more clear view.
'<div align = "center"><img src ="' . $imgs . '.' . $ex . '"/></div>';
That way it`s really more clear where ' or " starts and ends.
Try this:
You weren't closing your
'properly or using.in the echo when concatenating. Make sure you use a proper syntax highlighting tool, such as Sublime Text or Notepad++. This makes spotting errors like this much easier.