Login   Register  
PHP Classes
elePHPant
Icontem

File: usage.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of P Guardiario  >  PHP Str Match and Split  >  usage.php  >  Download  
File: usage.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Str Match and Split
Process strings with regular expressions
Author: By
Last change:
Date: 2013-01-23 01:00
Size: 315 bytes
 

Contents

Class file image Download
<?php
require 'phpstr.php';
echo 
str('There are 23 people reading this blog')->match('/\d+/') . "\n";
echo 
str('all of the es')->gsub('/e/''y') . "\n";
echo 
str('just the first e')->sub('/e/''y') . "\n";
var_dump(str('010 202 312 332')->scan('/\d+/'));
var_dump(str('010 202-312 332')->split('/\s/'));
?>