Category: PHP

I know that for the past few articles we’ve looked at strings, but we never actually talked about them. A string is just a sequence of characters surrounded by quotes; strings in PHP are placed inside either single or double quotes. In other programming languages, like Java, strings are surrounded by double quotes and individual characters are surrounded by single quotes.

The problem with that code is that PHP interpreter starts looking at the code and says: If you insist on having the single quotes surrounding the overall string, and use them inside the string itself, than you will have to “escape” the single quote character.

If you really wanted to use single quotes, you can concatenate (join) the variable with the concatenation (dot) operator.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners