1.31 kiriwrite_variablecheck

kiriwrite_variablecheck checkes variables that are passed to it to see if the content of that variable is valid and returns an error if it isn't. All the parameters are needed each time the subroutine is called and If the noerror parameter is set to 1 then a value is returned when an error occurs otherwise a standard error message will be given.

Parameters:

kiriwrite_variablecheck(variable, type, option, noerror);

Usage:

kiriwrite_variablecheck("Test 123", "lettersnumbers", "", 0);
$letters_letnum_check = kiriwrite_variablecheck("Test 123", "lettersnumbers", "", 1);

variable
Specifies the variable to check.

type
Specifies the test to check the variable with.

Value Description
numbers Check if the variable given only contains numbers.
lettersnumbers Check if the variable given only contains letters and numbers.
maxlength Check if the variable given does not exceed the specific length given.
blank Check if the variable given is blank.
filename Check if the variable given is a valid filename.
filenameindir Check if the variable given is a valid filename in a directory.
datetime Check if the variable given is a valid date and time format.
directory Check if the variable given is a valid directory name.
language_filename Check if the variable given is a valid language filename.
page_filename Check if the variable given is a valid page filename.
module Check if the variable given is a valid module name.
utf8 Check if the variable given is a correctly formatted UTF-8 string.
serverprotocol Check if the variable given is a valid server protocol.
port Check if the variable given is a valid server port number.

option
Specifies the setting to be used with the test.

noerror
Specifies if noerror message should be returned but a value should be returned so that a more specific error message can be created.

For more information on what values are returned, please look at the kiriwrite_error subroutine in the Kiriwrite source code.