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 public function border($width, $color = null)
{
$this->border_width = is_numeric($width) ? intval($width) : 0;
$this->border_color = is_null($color) ? '#000000' : $color;
}
<?php break;
case 'num':
case 'numeric':
$valid = is_numeric($value);
$message = '%s accepts only numeric values as argument %d.';
break;
case 'str':
<?php private function isDigit($value)
{
return is_numeric($value) ? intval($value) == $value : false;
}
}
<?php public function __construct($size = null)
{
$this->size = is_numeric($size) ? intval($size) : self::DEFAULT_SIZE;
}
<?php imagecopy($resource, $image->getCore(), 0, 0, 0, 0, $size->width, $size->height);
if (is_numeric($count) && $count <= 256) {
imagetruecolortopalette($resource, true, $count);
}
<?php private function getInternalFont()
{
$internalfont = is_null($this->file) ? 1 : $this->file;
$internalfont = is_numeric($internalfont) ? $internalfont : false;
if ( ! in_array($internalfont, [1, 2, 3, 4, 5])) {
throw new NotSupportedException(
<?php public function __construct($diameter = null)
{
$this->width = is_numeric($diameter) ? intval($diameter) : $this->diameter;
$this->height = is_numeric($diameter) ? intval($diameter) : $this->diameter;
$this->diameter = is_numeric($diameter) ? intval($diameter) : $this->diameter;
}
<?php public function __construct($diameter = null)
{
$this->width = is_numeric($diameter) ? intval($diameter) : $this->diameter;
$this->height = is_numeric($diameter) ? intval($diameter) : $this->diameter;
$this->diameter = is_numeric($diameter) ? intval($diameter) : $this->diameter;
}
<?php {
$this->width = is_numeric($diameter) ? intval($diameter) : $this->diameter;
$this->height = is_numeric($diameter) ? intval($diameter) : $this->diameter;
$this->diameter = is_numeric($diameter) ? intval($diameter) : $this->diameter;
}
<?php public function __construct($width = null, $height = null)
{
$this->width = is_numeric($width) ? intval($width) : $this->width;
$this->height = is_numeric($height) ? intval($height) : $this->height;
}
<?php public function __construct($width = null, $height = null)
{
$this->width = is_numeric($width) ? intval($width) : $this->width;
$this->height = is_numeric($height) ? intval($height) : $this->height;
}
<?php public function __construct($x = null, $y = null)
{
$this->x = is_numeric($x) ? intval($x) : $this->x;
$this->y = is_numeric($y) ? intval($y) : $this->y;
}
<?php public function __construct($x = null, $y = null)
{
$this->x = is_numeric($x) ? intval($x) : $this->x;
$this->y = is_numeric($y) ? intval($y) : $this->y;
}
<?php public function __construct($x1 = null, $y1 = null, $x2 = null, $y2 = null)
{
$this->x1 = is_numeric($x1) ? intval($x1) : $this->x1;
$this->y1 = is_numeric($y1) ? intval($y1) : $this->y1;
$this->x2 = is_numeric($x2) ? intval($x2) : $this->x2;
$this->y2 = is_numeric($y2) ? intval($y2) : $this->y2;
<?php public function __construct($x1 = null, $y1 = null, $x2 = null, $y2 = null)
{
$this->x1 = is_numeric($x1) ? intval($x1) : $this->x1;
$this->y1 = is_numeric($y1) ? intval($y1) : $this->y1;
$this->x2 = is_numeric($x2) ? intval($x2) : $this->x2;
$this->y2 = is_numeric($y2) ? intval($y2) : $this->y2;
}