This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation

Class Concrete5_Helper_Validation_Strings

Functions useful for validating strings

Direct known subclasses

ValidationStringsHelper

Package: Helpers\Validation
Category: Concrete
Copyright: Copyright (c) 2003-2008 Concrete5. (http://www.concrete5.org)
License: MIT License
Author: Andrew Embler andrew@concrete5.org
Located at core/helpers/validation/strings.php

Methods summary

public boolean
# email( string $em, $testMXRecord = false )

Validates an email address

public boolean
# alphanum( string $field, boolean $allow_spaces = false, boolean $allow_dashes = false )

Returns true on whether the passed field is completely alpha-numeric

public
# handle( $handle )

Returns true if the passed field is a valid "handle" (e.g. only letters, numbers, or a _ symbol

public boolean
# notempty( string $field )

Returns false if the string is empty (including trim())

public boolean
# min( string $str, integer $length )

Returns true on whether the passed string is larger or equal to the passed length

public boolean
# max( string $str, integer $length )

Returns true on whether the passed is smaller or equal to the passed length

public integer
# containsNumber( string $str )

Returns 0 if there are no numbers in the string, or returns the number of numbers in the string

public integer
# containsUpperCase( string $str )

Returns 0 if there are no upper case letters in the string, or returns the number of upper case letters in the string

public integer
# containsLowerCase( string $str )

Returns 0 if there are no lower case letters in the string, or returns the number of lower case letters in the string

public integer
# containsSymbol( string $str )

Returns 0 if there are no symbols in the string, or returns the number of symbols in the string

public boolean
# containsString( string $str, array $cont = array() )

Returns true if the string contains another string