PHP Classes

File: example/unicode.php

Recommend this page to a friend!
  Classes of Ve Bailovity  >  Misc String  >  example/unicode.php  >  Download  
File: example/unicode.php
Role: Example script
Content type: text/plain
Description: Example usage
Class: Misc String
Manipulate Unicode and unencoded strings
Author: By
Last change: Accessible without user login
Date: 15 years ago
Size: 1,198 bytes


Class file image Download
 * This is a test file for strUnicode class from MiscString package.
 * Run this file in your browser and submit some text.
 * @package Test MiscString
 * @author Vladislav Bailovic <>

include ('../miscstring.php');

$reply = @$_POST['text'];

$s = new strUnicode();

<!--------------------------- PREVIEW ------------------------->
<div style="border: 3px solid #EEE; margin: 2em">
    <dt>original</dt> <dd><strong><?=$reply?></strong></dd>
    <dt>strlen()</dt> <dd><?=strlen($reply)?></dd>
    <dt>strUnicode::strlen()</dt> <dd> <?=$s->strlen($reply)?></dd>
    <dt>substr(text, 3, 6)</dt> <dd><?=substr($reply, 3, 6)?></dd>
    <dt>strUnicode::substr(text, 3, 6)</dt> <dd><?=$s->substr($reply, 3, 6)?></dd>
<!--------------------------- FORM ------------------------->
<h3>Enter a string with special characters to test:</h3>
<form action='<?=$_SERVER['PHP_SELF']?>' accept-charset='utf-8' method='post'>
    <textarea rows='8'
        style="width:100%;border: 1px solid black" name='text'><?=(@$_POST['text']) ? @$_POST['text'] : 'Iñtërnâtiôn lizætiøn' ?></textarea>
    <br />
    <input type='submit' />

For more information send a message to info at phpclasses dot org.