PHP Classes

File: usage.php

Recommend this page to a friend!
  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: Update of usage.php
Date: 4 months ago
Size: 315 bytes


Class file image Download
require 'phpstr.php';
str('There are 23 people reading this blog')->match('/\d+/') . "\n";
str('all of the es')->gsub('/e/', 'y') . "\n";
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/'));