How to Write PHP Code in Laravel Blade

Laravel 6 , Laravel , Laravel 7

Nicesnippets

2605

21-03-2020


How to Write PHP Code in Laravel Blade

Hi Dev,

In this post, I will learn you how to write php code in laravel blade file.

I will explain step by step tutorial how to write php code in laravel. I’m going to show you about write php code in blade template laravel.

If you have question about write php code in laravel blade then i will give simple example with solution. In this article, we will implement a how to write php code in blade file in laravel. Here, Creating a basic example of how to write php code in laravel blade.Type a message

Example 1

@php

$myArray = [

"name" => "abc",

"city" => "def",

"mobile" => 123

];

print_r($myArray);

@endphp

Example 2

<?php

$myArray = [

"name" => "abc",

"city" => "def",

"mobile" => 123

];

print_r($myArray);

?>

It will help you...


Recommended Posts