You must either use:
echo 'I love my ' . $variable . '.';
This method appends the variable to the string.
Or you could use:
echo "I love my $variable.";
Notice the double quotes used here!
More Related Contents:
- Browser detection in PHP causes white screen [closed]
- Echo in an image
- How can I echo HTML in PHP?
- How to flush output after each `echo` call?
- PHP echo vs PHP short echo tags
- php – insert a variable in an echo string
- Reference: Comparing PHP’s print and echo
- What is the difference between PHP echo and PHP return in plain English?
- PHP to search within txt file and echo the whole line
- How are echo and print different in PHP? [duplicate]
- PHP POST not working
- How to use single quote inside an echo which is using single quote
- PHP printed boolean value is empty, why?
- Difference between php echo and return in terms of a jQuery ajax call [closed]
- How to echo in PHP, HTML tags
- Add PHP variable inside echo statement as href link address?
- How can I echo the whole content of a .html file in PHP?
- How to clear previously echoed items in PHP
- How to use css style in php
- php echo vs open&close tag
- PHP file_get_contents does not work on localhost
- What is the ASP.Net equivalent to PHP’s Echo?
- PHP Echo text Color
- URL Redirect / URL Masking [closed]
- How to Automatically Start a Download in PHP?
- jQuery AJAX form using mail() PHP script sends email, but POST data from HTML form is undefined
- PHP number format
- Scale Image Using PHP and Maintaining Aspect Ratio
- Setting a cookie in an AJAX request?
- Download multiple files as a zip folder using php [duplicate]