snday Posted December 12, 2006 Share Posted December 12, 2006 [code=php:0]$foo = 0,1,2,3,4,5[/code]I am wondering the best way to turn $foo into an arraywith each array value being seperated from each comma.Also, what is the preferred/best way to handle a permissions sql table/rowif each row is set up like(note, below is just an example illustration):Name | Permissionguest - post=0, comment=0, etc....I've seen many scripts use Constants and others using Serialize Link to comment https://forums.phpfreaks.com/topic/30380-array-from-comma-seperation/ Share on other sites More sharing options...
hitman6003 Posted December 12, 2006 Share Posted December 12, 2006 use the explode function.http://www.php.net/explode[code]$foo = "1,2,3,4,5";$foo = explode(",", $foo);[/code] Link to comment https://forums.phpfreaks.com/topic/30380-array-from-comma-seperation/#findComment-139802 Share on other sites More sharing options...
snday Posted December 12, 2006 Author Share Posted December 12, 2006 Thanks Link to comment https://forums.phpfreaks.com/topic/30380-array-from-comma-seperation/#findComment-139812 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.