Jump to content


Photo

using a range of numbers as a wildcard


  • Please log in to reply
2 replies to this topic

#1 stubarny

stubarny
  • Members
  • PipPipPip
  • Advanced Member
  • 123 posts

Posted 27 July 2006 - 06:16 PM

Hi,

I'm trying to search for a wildcard within a variable. My question is how can i set the wildcard to be a range of numbers?

e.g. my wildcard range of 19968 to 40891 should match the variable "&# 36544 ;"


Thanks for your help!

Stu

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 27 July 2006 - 06:21 PM

if (in_array(36544,range(19968,40891)) {
  echo "match found";
}


#3 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 27 July 2006 - 06:59 PM

not quite sure what you want, but this may help

<?php
$var = 36544;
if($var >= 19968 && $var <= 40891) echo 'match';
?>

Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users