Skip to content
Snippets Groups Projects
ArrayValidation.php 316 B
Newer Older
Адлан Шамавов's avatar
Адлан Шамавов committed
<?php

namespace App\Validation;

class ArrayValidation
{
Адлан Шамавов's avatar
Адлан Шамавов committed
    public static function validateFunc1(array $array): bool
Адлан Шамавов's avatar
Адлан Шамавов committed
    {
Адлан Шамавов's avatar
Адлан Шамавов committed
        $prices = array_column($array, 'price');
        $counts = array_column($array, 'count');
        return ctype_digit(implode('',$prices)) && ctype_digit(implode('', $counts));