Jump to content


Photo

search an array using search box (no database)


  • Please log in to reply
1 reply to this topic

#1 Rufus_84

Rufus_84

    Newbie

  • New Members
  • Pip
  • 3 posts

Posted 25 January 2013 - 11:24 AM

Hello.
I was wandering whether I can search an array for example $films = array ('Madagascar' => 'madagascar',
'Ice Age' => 'ice_age',
'Shrek' => 'shrek')
and display the result using while for example while(list($title, $link)=each($films){
echo "<a href=\"$link\">$title</a><br/>";}
so the result is a link to a page with the movie?

Can I do it without database?

appretiate any help

Rafal

#2 The Letter E

The Letter E

    Advanced Member

  • Members
  • PipPipPip
  • 266 posts

Posted 25 January 2013 - 09:12 PM

1. yes you can do it without a db
2. I wouldn't recommend it if you're expecting the data to be updated often, because you'd have to update it everytime, by hand
3. Maybe consider storing it in a flat file - .txt or .csv comes to mind - if you don't want to worry about setting up/managing/learning a db

Get more tech help @ http://devlifeline.com





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com