Login   Register  
PHP Classes
elePHPant
Icontem

File: string_mapping.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Manuel Lemos  >  Generic string mapping class  >  string_mapping.php  >  Download  
File: string_mapping.php
Role: ???
Content type: text/plain
Description: String mapping class
Class: Generic string mapping class
Generic string mapping.
Author: By
Last change:
Date: 15 years ago
Size: 490 bytes
 

Contents

Class file image Download
<?
/*
 * string_mapping.php
 *
 * @(#) $Header: /cvsroot/PHPlibrary/string_mapping.php,v 1.2 1999/07/23 02:10:04 mlemos Exp $
 *
 */

class string_mapping_class
{
 Function Map($string,&$mapping,$function="")
 {
  for($mapped="",$character=0;$character<strlen($string);$character++)
  {
   $code=Ord($string[$character]);
   $mapped.=(IsSet($mapping[$code]) ? $mapping[$code] : (strcmp($function,"") ? $function($string[$character]) : $string[$character]));
  }
  return($mapped);
 }
};

?>