Results 1 to 2 of 2

Thread: Verify variable in an array

  1. #1
    Join Date
    Jul 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Verify variable in an array

    I want to verify if a variable $userid is in array $user.
    If the $userid is in the $user array, I want to load an xml file for that $userid.

    How is this possible?

    I have been searching for an example to do this, but can't seem to find one.

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    in_array() ?

    If you Google "find value in array" you will find lots of examples.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

Similar Threads

  1. Making an array with a php variable
    By letom in forum PHP
    Replies: 8
    Last Post: 06-17-2013, 07:10 PM
  2. how to to pass array[x] to a variable?
    By ksquared3 in forum JavaScript
    Replies: 15
    Last Post: 02-07-2011, 12:51 PM
  3. Replies: 1
    Last Post: 05-17-2009, 04:55 AM
  4. Replies: 0
    Last Post: 01-24-2009, 06:46 AM
  5. Variable and array looping
    By Ampulator00 in forum JavaScript
    Replies: 0
    Last Post: 12-21-2004, 12:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •