www.webdeveloper.com
Results 1 to 2 of 2

Thread: IF statment with Array

  1. #1
    Join Date
    Mar 2011
    Posts
    9

    IF statment with Array

    I tried to check if some word is exist in some array but it does work - I used this code

    PHP Code:

    $some_array 
    = array( 'am','is','are' );

    if ( 
    $word == $some_array )
           echo 
    "found"

  2. #2
    Join Date
    Oct 2010
    Posts
    17
    Try:

    Code:
    $some_array = array( 'am','is','are' );
    if(in_array($word,$some_array))       echo "found";

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles