Phpfox_Parse_Format

Description

Common String Handling This class is used to run common methods on strings or do sanity checks on a string.

  • author: Raymond Benc
  • version: $Id: format.class.php 1687 2010-07-22 03:13:27Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/parse/format.class.php (line 17)


	
			
Method Summary
 string hideEmail (string $sEmail)
 bool isEmpty (string $sStr)
 bool isSerialized (string $sData)
 string phpCode (string $sCode)
 string unhtmlspecialchars (string $sString)
 string validXhtml (string $sStr)
 string _checkIfEmpty (array $aMatches)
Methods
hideEmail (line 145)

Hide the email service that is part of an email.

Usage:

  1.  echo Phpfox::getLib('parse.format')->hideEmail('foo@bar.com');
  2.  // Will output: foo@___.com

  • return: Email without the email service.
  • access: public
string hideEmail (string $sEmail)
  • string $sEmail: Email to remove the email service.
isEmpty (line 109)

Does a check to make sure a string is really not empty. This takes the PHP function empty a little further.

  • return: TRUE if string is empty, FALSE if not.
  • see: empty()
  • access: public
bool isEmpty (string $sStr)
  • string $sStr: String to check if it is empty or not.
isSerialized (line 25)

Checks if a given string is serialized or not.

  • return: TRUE if string is serialized, FALSE if not.
  • access: public
bool isSerialized (string $sData)
  • string $sData: Data to check.
phpCode (line 163)

Parse PHP code with the correct amount of backslashes when storing it in a flat file.

  • return: Parsed PHP code with the new backslashes in place.
  • access: public
string phpCode (string $sCode)
  • string $sCode: PHP code to parse.
unhtmlspecialchars (line 177)

Converting PHP htmlspecialchars()

string unhtmlspecialchars (string $sString)
  • string $sString: String to convert.
validXhtml (line 77)

Uses the class DOMDocument to clean HTML and make it valid XHTML.

string validXhtml (string $sStr)
  • string $sStr: String we need to parse.
_checkIfEmpty (line 196)

Check done via a callback within the isEmpty() method to see if a string is empty or not.

  • return: If string is empty we an emptry string, if not we return 1.
  • see: self::isEmpty()
  • access: private
string _checkIfEmpty (array $aMatches)
  • array $aMatches: ARRAY of matches passed by the callback.

Documentation generated on Tue, 28 Sep 2010 10:36:39 +0200 by phpDocumentor 1.4.0a2