0

I want to store in array, after filtering the data from in database and iterate throgh each data.

in business_cards variable stores the database data

 foreach($business_cards as $b) {
                    $new_arr[] = explode(',', $b->title);
                    $card[] =  $new_arr[0][0].'_'.$b->card_id; 
                    $count[] = $b->count; 
                }
2
  • what line does the error say is causing it? Commented Jan 4, 2022 at 14:12
  • Don't use an object as if it were an array. Presumably one of $new_arr, $card, or $count are an array. Commented Jan 4, 2022 at 19:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.