S
S
semki0962019-04-26 17:02:42
Laravel
semki096, 2019-04-26 17:02:42

What is the difference between two identical arrays, but described differently, using an example?

I want to extract an array of data from the model by id, and it works . But it doesn't work like that, why?
$products = Product::find( [3, 5, 8] );

$arr = array( 0 => 3, 1 => 5, 2 => 8 );
$products = Product::find($arr );

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lander, 2019-04-26
@semki096

Do you seriously think that this is the same thing? Does your IDE tell you anything about this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question