Php string to int. Unable to convert: undefined to type: string.