php - Insert specific value on first $key in array

Solution:
if(!empty($_POST['does_what']) && is_array($_POST['does_what'])){
$strings = array();
foreach($_POST['does_what'] as $key => $value){
if($value[$key] == 0){
$text = "This is ".$value
$value = array_unshift($strings[$key], $text );
}
else{
echo "Value is not a Zero";
}
$strings[] = $value;
}
}
else{
echo "Post is empty Or its not an array";
}
Answer
Solution:
I think you want something more like this:
foreach($_POST as $key => $value){
if (count( $strings) == 0)
$strings[] = "This is $value";
else
$strings[] = $value;
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: method illuminate\database\eloquent\collection::paginate does not exist.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.