Jump to content

pescatore

New Members
  • Posts

    2
  • Joined

  • Last visited

pescatore's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks to both of you for your time! @scootstah your script worked perfectly first time and helped me out immensely! I will try and repay the favour in the future, thanks again!!!
  2. Hi, I am very new to PHP and apologies if this question has already been answered in another thread. I am trying to extract the information from one array into another when some search criteria is matched. Here is an example array ($original): Array ( [ 1234567 ] => Array ( [name] => john ) [ 3456 ] => Array ( [name] => johnny ) [ 45673 ] => Array ( [name] => james ) [ 987 ] => Array ( [name] => jamie ) [ 5628721 ] => Array ( [name] => Simon )) So if I searched for the string john, jo, joh then the new array ($filtered) should be as follows: Array ( [ 1234567 ] => Array ( [name] => john ) [ 3456 ] => Array ( [name] => johnny )) I was trying to do this using array_search & preg_match but have been struggling. Any help would be much appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.