Emmash Posted October 8, 2008 Share Posted October 8, 2008 I just want to find a way to write the content of the variable $liste_tableaux_couleur in my function array_intersect() to have something like array_intersect($table1,$table2,$table3...) ... all the names of tables are in my variable $liste_tableaux_couleur but I can't do array_intersect($liste_tableaux_couleur) , because I get the error that the function needs 2 parameters, is there a way to write the values of my variable directly into the parenthesis of the function???? $liste_tableaux_couleur is not an array but a string variable that contains, by example, differents names of tables like "$table1,$table2,$table3" The variable $liste_tableaux_couleur is in a loop because it can contains 2 table or 3 or 4...etc... depending on what the users chose. Thanks a lot, Marie-Hélène Link to comment https://forums.phpfreaks.com/topic/127591-problems-with-arrays/ Share on other sites More sharing options...
Third_Degree Posted October 8, 2008 Share Posted October 8, 2008 $liste_tableaux_couleur = explode( ",", $liste_tableaux_couleur ); That might help you out. You can't use array_ functions without an array! Link to comment https://forums.phpfreaks.com/topic/127591-problems-with-arrays/#findComment-660152 Share on other sites More sharing options...
R0bb0b Posted October 8, 2008 Share Posted October 8, 2008 call_user_func_array() Link to comment https://forums.phpfreaks.com/topic/127591-problems-with-arrays/#findComment-660169 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.