What am I missing here?
Posted: Mon Sep 12, 2011 6:00 pm
I'm having trouble with the following code, and I know the correct data is here. For example, let's say both $category->category and $member_data[service_category] contain "Legal" - based on my understanding of strpos, this *should* make that field check. Am I missing something here?
Code: Select all
foreach ($network_categories as $category) {
$category_list .= '<input name="network_category_list[]" value="' . $category->category . '"';
$check_cat = strpos($category->category, $member_data[service_category]);
if($check_cat === true){
$category_list .= ' type="checkbox" checked="checked" > ' . $category->category . "\n";
} else {
$category_list .= ' type="checkbox"> ' . $category->category . "<br />\n";
}
}