Help with array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with array

    PHP Code:
    function test($type)
    {
    $ary = array("text","password","checkbox","radio","submit");
    if(
    $type !== $ary)
    {
    echo 
    "that type is not supported";
    }
    echo 
    "$type";

    pls what is worry with the array() above. If i call
    test("text");
    it work, but telling me that
    that type is not supported.

    #2
    Post the complete code
    libra.wen.ru

    Comment


      #3
      Here solution:
      PHP Code:
      <?
      //By C0ol
      function test($type)
      {
      $ary = array("text","password","checkbox","radio","submit");

      if(!in_array($type,$ary))
      {
      echo "that type is not supported";
      }

      echo $type;
      }  

      echo "<br />";

      test(text);

      ?>

      Comment

      Working...
      X