strlen/2 and len/2—determine the length of a  string


The strlen/2 and len/2  functions determine the length of a string. The general syntax for this function is as follows: 

Note

The len/2 function has the same functionality as strlen/2 but exists only as a function.

strlen($STR,$LEN)
$LEN=strlen($STR)
$LEN=len($STR)

strlen/2 and len/2 arguments

Argument

Mode

Type

Description

$STR

Input

STRING

The string for which the length is to be returned

$LEN

Output

INTEGER

String length in characters

Use the strlen/2 function to calculate the length of the string $STR and return the number of characters in the string in the $LEN argument.

Note

The number of characters in the string might differ from the number of bytes needed to store the string.

strlen/2 example

$MSGLEN = strlen($E.msg);

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*