getid3_id3v2::IsANumber

Advertisement

Syntax Syntax

getid3_id3v2::IsANumber( string $numberstring, bool $allowdecimal = false, bool $allownegative = false )

Parameters Parameters

$numberstring

(string) (Required)

$allowdecimal

(bool) (Optional)

Default value: false

$allownegative

(bool) (Optional)

Default value: false

Return Return

(bool)

Source Source

File: wp-includes/ID3/module.tag.id3v2.php

	/**
	 * @param string $numberstring
	 * @param bool   $allowdecimal
	 * @param bool   $allownegative
	 *
	 * @return bool
	 */
	public static function IsANumber($numberstring, $allowdecimal=false, $allownegative=false) {
		for ($i = 0; $i < strlen($numberstring); $i++) {
			if ((chr($numberstring[$i]) < chr('0')) || (chr($numberstring[$i]) > chr('9'))) {
				if (($numberstring[$i] == '.') && $allowdecimal) {
					// allowed
				} elseif (($numberstring[$i] == '-') && $allownegative && ($i == 0)) {

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

What are you looking for?