in_array() problem

From: Craig Keightley (craig_at_sitedesign.net)
Date: 03/30/04


Date: Tue, 30 Mar 2004 16:11:50 +0100

I am trying to compare values of a string entered into an array but having
no results, is this possible to achieve:

<?php
     $ids = $row_rsProduct['itemList']; // A comma separated list of values
(1,2,3,4,5,6,7,8)
    $list = array($ids);
      if (in_array(1, $list)) {
   echo "In List";
}
?>

I have no results but i cannot see why

Any help would be grateful

Craig



Relevant Pages

  • in_array() problem
    ... I am trying to compare values of a string entered into an array but having ... Craig ...
    (comp.lang.php)
  • Re: Newbie PHP question operators
    ... >> I'm having trouble using operators. ... > then using foreach keywords traverse each element in array and compare ... I guess I need should go get a php ...
    (comp.lang.php)
  • Re: Need help on PHP for MPE/ix
    ... Here is the syntax of the dbupdate intrinsic in PHP: ... assoc array of item values) ... Please let me know if you have any more suggesstions to solve this problem. ... Pavan Kumar Rati wrote: ...
    (comp.sys.hp.mpe)
  • Re: PHP - I give up.
    ... /* Compares A and B, given auxiliary data AUX, and returns a ... typedef int algo_predicate_func (const void *data, ... SIZE bytes each, using COMPARE for comparisons. ... first element in ARRAY that matches TARGET, ...
    (comp.programming)
  • Re: Using a RegEx as a "variable" WITHIN an array?
    ... believe the PHP one is also based upon. ... combination of 1 or more numerics in this instance would give you your ... add this to your array - you could then do a pattern match on the array ... > Dim selCriteria as String ...
    (microsoft.public.dotnet.framework.aspnet)