Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Elyess Zouaghi  >  String Class  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: demo
Class: String Class
Manipulate text strings
Author: By
Last change: removed list of supported methods, for full list see string.class.php file
Date: 2010-02-21 16:55
Size: 618 bytes
 

Contents

Class file image Download
<?php
    
require ("string.class.php");
    
    
$s = new String("Hello World !");
    
    echo 
$s;
    
    echo 
"<br>";
    
    echo 
$s->toUpper();
    
    echo 
"<br>";
    
    echo 
$s->toLower();
    
    echo 
"<br>";
    
    echo 
$s->substr(05)->length();
    
    echo 
"<br>";
    
    
$h = new String("hello");
    
    if (
$s->substr(05)->toLower() == $h) {
        echo 
"it's hello";
    }
    
    echo 
"<br>";
    
    if (
$h->not("world")) {
        echo 
"it's not world!";
    }
    
    echo 
"<br>";
    
    
$x $s->concat(" yes "$h);
    
    echo 
$x;
    
    echo 
"<br>";
    
    echo (
$x->toLower()->eq("hello world ! yes hello") ? "it's full lower!" "not full lower");
?>