SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2011
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    check a string against a JSON decoded string

    Hello,

    I have 1) a comma delimited string that is the result of a JSON decode and 2) an array composed of various strings.

    I want to see which elements of the array are also found in the comma delimited string.

    Code JavaScript:
    //var myarray;
    //var jsondecoded;
    for (var k in myarray) {
      if(myarray[k] isFoundIn jsondecoded) {
        //do something
      }			          
    }

    Obviously, the isFoundIn bit doesn't work... Anyone know how I should proceed?


  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,197
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)


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
  •