ARRAY and SEARCH Button
Moderator: General Moderators
-
bluekhille
- Forum Commoner
- Posts: 25
- Joined: Thu Jul 16, 2009 6:49 am
Re: ARRAY and SEARCH Button
i was able to display the records already im now working on searching and im getting hard time on it argh 
Re: ARRAY and SEARCH Button
I gave you the code!!! How can you "get a hard time"!?!??!
Look:
That is the exact code - I've handed it to you on a plate.
Look:
Code: Select all
<?php
$array = array(
'this is about football',
'this is about basketball',
'this is about....something else',
'blah',
'foo'
);
$search = 'basketball';
foreach($array as $key => $value)
if(!stristr($value, $search))
unset($array[$key]);
print_r($array);-
bluekhille
- Forum Commoner
- Posts: 25
- Joined: Thu Jul 16, 2009 6:49 am
Re: ARRAY and SEARCH Button
jackpf wrote:I gave you the code!!! How can you "get a hard time"!?!??!![]()
Look:That is the exact code - I've handed it to you on a plate.Code: Select all
<?php $array = array( 'this is about football', 'this is about basketball', 'this is about....something else', 'blah', 'foo' ); $search = 'basketball'; foreach($array as $key => $value) if(!stristr($value, $search)) unset($array[$key]); print_r($array);
quite confuse coz im using multidimensional arrays. i tried what you gave me but im getting errors so imtrying to fix it thanks for the code i'll just try to modify it to solve it