PHP Classes

File: teststrforeach.php

Recommend this page to a friend!
  Classes of zinsou A.A.E.Mo´se  >  PHP String Foreach  >  teststrforeach.php  >  Download  
File: teststrforeach.php
Role: Example script
Content type: text/plain
Description: example script
Class: PHP String Foreach
Process strings as arrays of characters
Author: By
Last change: Example for new version
Date: 3 years ago
Size: 1,712 bytes
 

Contents

Class file image Download
<?php
require_once('./chars.class.php');

echo
'<pre>';
$exemple=new Chars('I want to get all of words from this sentence.

After having owned the BMW X3, the MDX is a pleasure to drive. Reliability is great for 25,000 miles. Only things wrong are Bluetooth; rings and cannot hear whose on the other end and many viable addresses do not show up on Navigation system. Dealer service excellent. A few miss-steps in design; no lights for A/C controls at night; rear view pic doesn\'t come on in reverse for 10 seconds, some wind noise, transmission can be rough and erratic. No ipod plug which I didn\'t realize until after I purchased. Front end design could be improved, very masculine. Sounds like a lot but I do really like this car. Also test drove BMW X5 and Lexus 400.'
);
print_r($exemple->explode('\word'));
echo
nl2br($exemple->wordwrap());
echo
'<h2>Find all the phrases in a given string</h2>';
print_r($exemple->explode('#\W#u'));
       
       
$Chars= new Chars (' hail mary 2pac amaru shakur >> 1');
echo
'<pre>';
echo
$Chars->trim()->sub_stri_position_add('a','po',3,false)->stri_position_replace('A','',2)->delete_last()->delete_first()->str_position_toupper('a',2)->str_position_add('a',3);

$exemple=new Chars('Nbvjjjjjv .hhhwjjjjjdhjjjjd. ghjaudUUyyUUggue. ghjauduuyyuuggue.ghjauduuyyuuggue.
ghjauduuyyuuggue.
ghjauduuyyuuggue. ghuuuuu'
);
echo
$exemple->upper_sentence_start()->data()->count_UnicodeChars();

var_dump(preg_match('#^N#i',$exemple));
$auth =chars("24\tLewis Carroll");
$n = sscanf($auth, "%d\t%s %s", $id, $first, $last);
echo
"<author id='$id'>
    <firstname>
$first</firstname>
    <surname>
$last</surname>
</author>\n"
;
echo
'<pre>';
?>

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