is_numeric

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Finds whether a variable is a number or a numeric string
<?php is_numeric(mixed $value): bool
<?php                 $components = json_decode(file_get_contents($tmp));



                foreach ($components as $name => $class) {

                    if (is_numeric($name)) {

                        app('livewire')->component($class);

                    } else {

                        app('livewire')->component($name, $class);
<?php     static function isAPrimitive($target) {

        return

            is_numeric($target) ||

            is_string($target) ||

            is_bool($target) ||

            is_null($target);
<?php     static function escapeStringForHtml($subject)

    {

        if (is_string($subject) || is_numeric($subject)) {

            return htmlspecialchars($subject, ENT_QUOTES|ENT_SUBSTITUTE);

        }
<?php         $listeners = static::getComponentListeners($component);



        return collect($listeners)

            ->map(fn ($value, $key) => is_numeric($key) ? $value : $key)

            ->values()

            ->toArray();

    }
<?php         $listeners = static::getComponentListeners($component);



        foreach ($listeners as $event => $method) {

            if (is_numeric($event)) $event = $method;



            if ($name === $event) return $method;

        }
<?php     static function replaceDynamicEventNamePlaceholers($listeners, $component)

    {

        foreach ($listeners as $event => $method) {

            if (is_numeric($event)) continue;



            $replaced = static::replaceDynamicPlaceholders($event, $component);
<?php             $isValid = true;



            foreach ($value as $key => $arrayValue) {

                if (!($arrayValue instanceof TemporaryUploadedFile) || !is_numeric($key)) {

                    $isValid = false;

                    break;

                }
<?php                 throw new \LogicException('Something went wrong');

            }



            if (!is_numeric($segment) && array_key_exists($segment, $segmentRules)) {

                $segmentRules = $segmentRules[$segment];

                $has = true;

                continue;
<?php                 continue;

            }



            if (is_numeric($segment) && array_key_exists('*', $segmentRules)) {

                $segmentRules = $segmentRules['*'];

                $has = true;

                continue;
<?php                 continue;

            }



            if (is_numeric($segment) && in_array('*', $segmentRules, true)) {

                $has = true;

                $end = true;

                continue;
<?php     public function setPage($page, $pageName = 'page')

    {

        if (is_numeric($page)) {

            $page = (int) ($page <= 0 ? 1 : $page);

        }
<?php             foreach ($components as $name => $class) {

                if (is_object($class)) $class = $class::class;



                if (is_numeric($name)) {

                    app('livewire')->component($class);

                } else {

                    app('livewire')->component($name, $class);
<?php             $name = array_shift($otherComponents);



            foreach ($otherComponents as $key => $value) {

                if (is_numeric($key)) {

                    app('livewire')->isDiscoverable($name) || app('livewire')->component($value);

                } else {

                    app('livewire')->component($key, $value);
<?php         if (is_null($this->rule)) {



        } elseif (is_array($this->rule) && count($this->rule) > 0 && ! is_numeric(array_keys($this->rule)[0])) {



            $rules = $this->rule;
<?php     {

        return collect($attributes)

                ->map(function (string $value, string $attribute) use ($escapeBound) {

                    return $escapeBound && isset($this->boundAttributes[$attribute]) && $value !== 'true' && ! is_numeric($value)

                                ? "'{$attribute}' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute({$value})"

                                : "'{$attribute}' => {$value}";

                })