PHP Classes
elePHPant
Icontem

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:
Date: 6 months ago
Size: 1,805 bytes
 

Contents

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

echo
'<pre>';
echo
'<h2> Upper all the first letter of each phrase in the given string</h2>';
$exemple=new Stringforeach('Nbvjjjjjv .hhhwjjjjjdhjjjjd. ghjaudUUyyUUggue. ghjauduuyyuuggue.ghjauduuyyuuggue.
ghjauduuyyuuggue.
ghjauduuyyuuggue. ghuuuuu'
);
var_dump($r=$exemple->upper_1stletter('u'));

echo
'<h2>find a given array of patterns occurences and their positions </h2>';

$exemple=new Stringforeach('Mon chat est gros,papa est gras et mes habits, sont gris.Mon chat est gras!Mon papa progresse ? et ma maman est grosse.');
print_r($exemple->patternsmatchespos(array('#gr[iaoe]s#','#abi#'),'en'));
echo
'<h2>test if the given string contains at least one of the elements in the given array of patterns</h2>';
var_dump($exemple->patternsmatches(array('#gr[iaoe]s#','#abi#')));
echo
'<h2>Find all the words in a given string</h2>';
$exemple=new Stringforeach('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->explodemore('word','en'));
echo
'<h2>Find all the phrases in a given string</h2>';
print_r($exemple->explodemore('phrase','en'));


echo
'<pre>';
?>