PHP Classes

File: example.php

Recommend this page to a friend!
  Packages of jarosek   OString   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example (dummy) usage
Class: OString
Manipulate text strings
Author: By
Last change: N/A
Date: 16 years ago
Size: 470 bytes
 

Contents

Class file image Download
<?php
/**
 * Demonstraion of OString class capabilities
 */
require 'class/Ostring.php';

echo S::wrap('Start')
    ->append(' string.')
        ->capitalize()
        ->toLower()
        ->trim()
        ->substring(6, 5)
        ->pad('-',20);

$s = new OString('Test');
if ($s->endsWith('t')
        && $s->startWith('T')
        && $s->contains('es')
        && $s->indexOf('es') >= 1
        && $s->length() > 2
    )
{
    echo 'Ok';
}
?>