Jump to content


search an array using search box (no database)

  • Please log in to reply
1 reply to this topic

#1 Rufus_84

  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 25 January 2013 - 04:24 PM

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


#2 The Letter E

The Letter E
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 26 January 2013 - 02:12 AM

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

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users