I make use of Laravel 5.3.
I have a variable that returns this value in a var_dump ():
array(3) {
[1]=>
string(5) "10:00"
[2]=>
string(5) "10:20"
[3]=>
string(5) "11:40"
}
But if I give:
@foreach($variavel as $valor)
<label for="{{$valor}}"> {{$valor}} </label>
<input type="checkbox" id="{{$valor}}" name="horario[0][]" />
@endforeach
He printed this out:
<label for="10:00">10:00</label>
<input type="checkbox" id="10:00" name="horario[0][]" />
<label for="10:20">10:20</label>
<input type="checkbox" id="10:20" name="horario[0][]" />
<label for="11:40">11:40</label>
<input type="checkbox" id="11:40" name="horario[0][]" />
And if I do:
@foreach($variavel as $valor)
<label for="{{print $valor}}"> {{print $valor}} </label>
<input type="checkbox" id="{{print $valor}}" name="horario[0][]" />
@endforeach
Print this:
10:00 1 10:20 1 11:40 1
I do not understand where this number 1 can come after each value printed, because if you do this print within the PHP tags it does not appear. What could cause this? Could I be clear? ps: between the value and the number 1 is the checbox?