@strlen & @trim - String Length and Trimming
The @strlen
and @trim
directives in Ahmed PHP Template Engine allow you to work with string lengths and remove whitespace.
Syntax
stringValue
: The string to be processed.
Description
@strlen
returns the length of a string (number of characters).@trim
removes whitespace from the beginning and end of a string.Useful for text processing, validation, and formatting.
Example
Get String Length
Expected Output:
Trim Whitespace
Expected Output:
Notes
@strlen
does not count whitespace separately.@trim
is useful for cleaning up user input before processing.Works with variables and direct string values.
Last updated