Marook-Online
* 06.Feb.2012, 14:35 UTC+1
Welcome, Guest. Please login or register.
Username:
Password:

News: Back again Wink
Main Menu
  Navigation
   Downloads
     Tools
     Music Discs
     SMF Mods
     Trainer & Patches
     EgoShare Uploader
   Guestbook
   NoPaste
   User Map
   Gallery
  
   Malware Scan
   Hacker Blacklist
   Find Abusemail
Top Downloads
Support Me !
Help me by donating a small amount!



Advanced search

Google


Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read
31-May-2008 15:51
Marook
Administrator
*****
Offline Offline

Joined: 01-Jan-2005
Posts: 224


I wrote a function to search in an array using a * as wildcard and optional returning the matched value or even the next using an offset Wink Have fun...

Code
GeSHi (php):
  1. function in_Arrayw($haystack, $needle, $offset=0) {
  2.  $i = 0;
  3.  foreach ($haystack as $value){
  4.      if (eregi($needle, $value)!=false){
  5.          $value = ($offset==0) ? $value : $haystack[$i+$offset];
  6.          return $value;
  7.      }
  8.      $i++;
  9.  }
  10.  return false;
  11. }
  12.  
Created by GeSHI 1.0.7.20

Usage :
Code
GeSHi (php):
  1. $arr = array('marook','online','website');
  2. echo in_arrayw($arr,'mar*');   returns marook
  3. echo in_arrayw($arr,'mar*',1);   returns online
  4. echo in_arrayw($arr,'w*');   returns website
  5. echo in_arrayw($arr,'*e');   returns online
  6. echo in_arrayw($arr,'test*');   returns false
  7.  
Created by GeSHI 1.0.7.20
Logged
 

Pages: [1]   Go Up
Jump to:  

Theme by webtechnica.net

MHD v2.1 © 2oo8 by Marook
32116 hacking attempts defended!