title: Check if value exists in comma separated string with PHP
body: <p>I need to check if my id exists in comma separated string.</p>
  
  <p>My string is saved as <code>"1,2,3,4,10"</code> in database.</p>
  
  <p>I have tried </p>
  
  <pre><code>$HiddenProducts = array($sqlvalue);
  
  if (in_array(2, $HiddenProducts)) {
    echo "Available";
  } else {
    echo "Not available";
  }
  </code></pre>
  
  <p>It is not working. Any solutions please...</p>