Login   Register  
PHP Classes
elePHPant
Icontem

File: ChangeCharacters.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Juan Chaves  >  Change Characters  >  ChangeCharacters.php  >  Download  
File: ChangeCharacters.php
Role: Example script
Content type: text/plain
Description: Change Chatacters
Class: Change Characters
Replace characters in a text strings
Author: By
Last change:
Date: 2010-08-14 04:24
Size: 604 bytes
 

Contents

Class file image Download
<?php


//class change characters


class ChangeCharacters
{

private 
$allowed;

 

public function 
change_to($view)

{

    
$change=$view;
    
$matriz['á']="a";//Delete or add characters to be replaced.
    
$matriz['-']="";
    
$matriz['_']="";
    
$matriz[' ']="";
    
$view2=strtr($change,$matriz);
    
    
$this->allowed=$view2;
    return 
$this->allowed;
    
}

    public function 
go()
    {  
    
  echo 
$this->allowed

    }

}


//example of how to apply

$info=new ChangeCharacters();
$info->change_to("Página_1 3");//Please insert here the characters to be changed.
$info->go();

?>