Hyaku_ Posted March 26, 2007 Share Posted March 26, 2007 Hi! I have an array and a variable, when I try to check if variable already exists in the array, I get that error all the time. $my_var = "Some Var"; $my_arr[0] = "123"; $my_arr[1] = "456"; ... if(in_array($my_var, $my_arr, true)){ .. } any suggestions please? thank you! Link to comment https://forums.phpfreaks.com/topic/44356-warning-in_array-wrong-datatype-for-second-argument-why/ Share on other sites More sharing options...
trq Posted March 26, 2007 Share Posted March 26, 2007 Weird. Try... $my_arr = array(); $my_arr[0] = "123"; $my_arr[1] = "456"; Link to comment https://forums.phpfreaks.com/topic/44356-warning-in_array-wrong-datatype-for-second-argument-why/#findComment-215456 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.