[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/phpgwapi/inc/horde/Horde/ -> String.php (sommaire)

(pas de description)

Poids: 555 lignes (19 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

String:: (14 méthodes):
  setDefaultCharset()
  convertCharset()
  lower()
  upper()
  ucfirst()
  substr()
  length()
  pos()
  pad()
  wrap()
  isAlpha()
  isLower()
  isUpper()
  regexMatch()


Classe: String  - X-Ref

The String:: class provides static methods for charset and locale safe
string manipulation.

$Horde: framework/Util/String.php,v 1.50 2005/02/10 17:09:44 jan Exp $

Copyright 2003-2005 Jan Schneider <jan@horde.org>

See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

setDefaultCharset($charset)   X-Ref
Sets a default charset that the String:: methods will use if none is
explicitely specified.

param: string $charset  The charset to use as the default one.

convertCharset($input, $from, $to = null, $recursion = false)   X-Ref
Pas de description

lower($string, $locale = false, $charset = null)   X-Ref
Makes a string lowercase.

param: string  $string   The string to be converted.
param: boolean $locale   If true the string will be converted based on a
param: string  $charset  If $locale is true, the charset to use when
return: string  The string with lowercase characters

upper($string, $locale = false, $charset = null)   X-Ref
Pas de description

ucfirst($string, $locale = false, $charset = null)   X-Ref
Returns a string with the first letter capitalized if it is
alphabetic.

param: string  $string   The string to be capitalized.
param: boolean $locale   If true the string will be converted based on a
param: string  $charset  The charset to use, defaults to current charset.
return: string  The capitalized string.

substr($string, $start, $length = null, $charset = null)   X-Ref
Returns part of a string.

param: string $string  The string to be converted.
param: int $start      The part's start position, zero based.
param: int $length     The part's length.
param: string $charset The charset to use when calculating the part's
return: string  The string's part.

length($string, $charset = null)   X-Ref
Returns the character (not byte) length of a string.

param: string $string  The string to return the length of.
param: string $charset The charset to use when calculating the string's
return: string  The string's part.

pos($haystack, $needle, $offset = 0, $charset = null)   X-Ref
Returns the numeric position of the first occurrence of $needle
in the $haystack string.

param: string $haystack  The string to search through.
param: string $needle    The string to search for.
param: int $offset       Allows to specify which character in haystack
param: string $charset   The charset to use when searching for the
return: int  The position of first occurrence.

pad($input, $length, $pad = ' ', $type = STR_PAD_RIGHT,$charset = null)   X-Ref
Returns a string padded to a certain length with another string.

This method behaves exactly like str_pad but is multibyte safe.

param: string $input    The string to be padded.
param: int $length      The length of the resulting string.
param: string $pad      The string to pad the input string with. Must
param: const $type      The padding type. One of STR_PAD_LEFT,
param: string $charset  The charset of the input and the padding
return: string  The padded string.

wrap($text, $length = 80, $break_char = "\n", $charset = null,$quote = false)   X-Ref
Wraps the text of a message.

param: string $text                 String containing the text to wrap.
param: optional integer $length     Wrap $text at this number of
param: optional string $break_char  Character(s) to use when breaking
param: optional string $charset     Character set to use when breaking
param: optional boolean $quote      Ignore lines that are wrapped with
return: string  String containing the wrapped text.

isAlpha($string, $charset = null)   X-Ref
Returns true if the every character in the parameter is an
alphabetic character. This method doesn't work with any charset
other than the current charset yet.

param: $string   The string to test.
param: $charset  The charset to use when testing the string.
return: boolean  True if the parameter was alphabetic only.

isLower($string, $charset = null)   X-Ref
Returns true if every character in the parameter is a lowercase
letter in the current locale.

param: $string   The string to test.
param: $charset  The charset to use when testing the string.
return: boolean  True if the parameter was lowercase.

isUpper($string, $charset = null)   X-Ref
Returns true if every character in the parameter is an
uppercase letter in the current locale.

param: string $string   The string to test.
param: string $charset  The charset to use when testing the string.
return: boolean  True if the parameter was uppercase.

regexMatch($text, $regex, $charset = null)   X-Ref
Performs a regex match search on the text provided.  Will correctly
handle text with multibyte characters if the mbstring extensions and
the mbregex functions are available.  Will use the preg_match()
function if possible or if the mbregex ereg function is not available.

param: string $text     The text to search.
param: array $regex     The regular expressions to use.  These
param: string $charset  The character set of the text.
return: array  The matches array from the first regex that matches.



Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7