In PHP we echo strings this way :
echo 'string';
But i saw PHP frameworks like Laravel and scripts echo strings using Curly Brackets :
{string}
How i can do that without using any PHP framework?
It's not necessary to use Curly Brackets if there is other way to short echo!
I prefer code examples.
PHP has a few methods to print strings, such as (but not limited to) print, and echo or just shorthand <?= "str" ?>.
The bracket print that you ask about from laravel is not per say in php.
That is from a template engine called Blade.
So the {} way of printing stuff is not possible in php.
You will have to stick to the standard ways or use a template engine!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With