Skip navigation.
Home

zend_atoi()

Converts a string containing a suffix into an integer

zend_atoi(const char* str, int str_ren)


Returns:

int

Parameters:

type parameter description
const char* str string to convert
int str_len number of characters in the string, if 0 is given this will be calculated

This function converts a string containing numbers and ending in k, K, m, M, g or G into an appropriate integer. For example, "2K" will become 2048; "5G" will become 5368709100

Example:

bytes = zend_atoi("100G",0);