$resultArray = [];
for($i = 0; $i< count($array); $i++){
$resultArray[$array[$i]['COUNTER-ID']] = $i;
}
echo $resultArray[14]; // последний ключ в массиве для COUNTER-ID == 14
echo $array[$resultArray[14]]['VALUE']; //значение VALUE для последнего Counter-id == 14
$date = new \DateTime();
$date->modify('last Monday');
echo $date->format('Y-m-d');
$form = $this->getServiceLocator()->get('FormElementManager')->get('Blog\Form\Post');
if($this->params()->fromPost()){
$form->setData($this->params()->fromPost());
if($form->isValid()){
$service = $this->getServiceLocator()->get('Blog\Service\Post');
$post = $service->createPost($form->getData());
$this->flashMessenger()->addSuccessMessage($this->translate('Сообщение'));
$this->redirect()->toRoute('blog/post',['post' => $post->getId()]);
}
}
return new ViewModel(['form' => $form]);