This is a simple enough issue to fix...
When you use single quotes ( ' ), PHP reads the string literally!
If you use double quotes ( " ), PHP tries to parse variables and other information contained in the string.
I see that you use concatenation (using the period "." to connect two or more strings) which can be used like so:
| PHP |
$variable1 = "Hello";
$title = $variable . "1";
echo $title;
|
Also, since you don't have anything special in your $title definition second part ,you can also do this:
| PHP |
$variable1 = "Hello";
$title = $variable . '1';
echo $title;
|
Really, the variable doesn't need to be in any quotes unless it is in the middle of a string and then it has to be in double quotes to work but closing a string then using concatenation to add the variable to the string then use concatenation again before opening your quotes again to continue your string definition like so:
| PHP |
$input = 'first';
$output = 'This is me string which is the ' . $insert . ' string in the code.';
|
would look like this:
This is me string which is the first string in the code.
There are other ways to do what you are wanting including string replacement or regular expression replacement.
vujsa