How to remove number from right string in php?

The function will remove numeric characters at the end of the string.

1. Code:

  0) {
			return substr($str, 0, $i + 1);
		}
		return $str[$i];
	}
	$str = "Soltuts.com is providing PHP tutorials 12345";
	echo(removeNumericFromRightString($str));
    ?>

2. Example:

Input:

"Soltuts.com is providing PHP tutorials 12345"

Output:

Soltuts.com is providing PHP tutorials