Please can someone help me with this before I explode!!! (no pun intended)
<?php
// EXAMPLE 1
$text = "This is Driving me mad";
$check = "Driving";
$ss = "([ ][0-9a-zA-Z ½\',\.]{0,30}".$check. "[0-9a-zA-Z ½\',\.]{0,30}[ ])";
preg_match($ss, $text,$check);
echo "result = $check[0]"; //gives a result
echo "<br>";
// EXAMPLE 2
$text = "This is Driving me mad";
$check = "driving"; // NOTE CHANGE Driving to driving
$ss = "([ ][0-9a-zA-Z ½\',\.]{0,30}".$check. "[0-9a-zA-Z ½\',\.]{0,30}[ ])";
preg_match($ss, $text,$check);
echo "result = $check[0]"; // gives nothing.
?>
According to php.net /i is required to make it case sensitive, so why is
this happening?!?!
Nel.
--
DISCLAIMER: There is an extremely small but nonzero chance that,
through a process known as "Tunneling" , this e-mail may spontaneously
disappear from its present location and reappear at any random place in the
Universe, including your neighbour's domicile. The sender will not be
responsible for any damages or inconvenience that may result.
<?php
// EXAMPLE 1
$text = "This is Driving me mad";
$check = "Driving";
$ss = "([ ][0-9a-zA-Z ½\',\.]{0,30}".$check. "[0-9a-zA-Z ½\',\.]{0,30}[ ])";
preg_match($ss, $text,$check);
echo "result = $check[0]"; //gives a result
echo "<br>";
// EXAMPLE 2
$text = "This is Driving me mad";
$check = "driving"; // NOTE CHANGE Driving to driving
$ss = "([ ][0-9a-zA-Z ½\',\.]{0,30}".$check. "[0-9a-zA-Z ½\',\.]{0,30}[ ])";
preg_match($ss, $text,$check);
echo "result = $check[0]"; // gives nothing.
?>
According to php.net /i is required to make it case sensitive, so why is
this happening?!?!
Nel.
--
DISCLAIMER: There is an extremely small but nonzero chance that,
through a process known as "Tunneling" , this e-mail may spontaneously
disappear from its present location and reappear at any random place in the
Universe, including your neighbour's domicile. The sender will not be
responsible for any damages or inconvenience that may result.
Comment