本文整理汇总了PHP中CString::toIntFromBase方法的典型用法代码示例。如果您正苦于以下问题:PHP CString::toIntFromBase方法的具体用法?PHP CString::toIntFromBase怎么用?PHP CString::toIntFromBase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CString
的用法示例。
在下文中一共展示了CString::toIntFromBase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toIntFromBase
/**
* Converts a string with an arbitrary-base integer into the corresponding integer value.
*
* The string may be prefixed with "0x" for the base of 16.
*
* @param string $string The string to be converted.
* @param int $base The base in which the integer is represented by the string. Can be a number in the range from
* 2 to 36.
*
* @return int The integer value represented by the string.
*/
public static function toIntFromBase($string, $base)
{
assert('is_cstring($string) && is_int($base)', vs(isset($this), get_defined_vars()));
return CString::toIntFromBase($string, $base);
}