how to match a string containing special characters with sub

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Mon Jul 08, 2013 2:58 am

if you want to match a single time, then use stripos(). Otherwise use preg_match_all()

johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Mon Jul 08, 2013 3:02 am

Try this:

$team="/Sri/";
$c="West-Indies-vs-Sri-Lanka-5th-Match";
$d=preg_match($c,$team,$matches);

http://phillipnb.wordpress.com/2011/03/ ... ns-part-1/

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests