0
I’m trying to use explode to display the first name of a resume model, in a table in the view, I was initially using the method below, but it didn’t work out the way I wanted, because it only displayed the full name of the same model in different columns. I’d like to know how to fix it in a way that fits better with what I want.
@foreach(explode(" ", $registro->nome) as $FirstNome)
<td>{{ $FirstNome}}</td>
@endforeach
@endif ```
You need to take a closer look at how the explode works, it returns a matrix... https://www.php.net/manual/en/function.explode.php
– MagicHat
@Magichat got it, it’s just that in my case I’d just like to get the person’s first name, you know?
– Souza Elvis
Which way I could do it?
– Souza Elvis
Gives a studied in the documentation examples, makes a test in a separate script to familiarize with the function and then you implement in your code.
– MagicHat