J
J
Jedi2018-04-06 19:01:26
Laravel
Jedi, 2018-04-06 19:01:26

How to get first letter from string?

Hello!
Why doesn't {{ $user->name[0] }} work ?
How to get the first letter inside blade templating engine?
Thanks to.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2018-04-06
@PHPjedi

{{ Str::limit($myVariable, 1) }}

V
Vanik Khachatryan, 2018-04-06
@VaniXac

substr("string", 0, 0);

T
Tesla, 2018-04-06
@Tesla

mb_substr

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question