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 Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
snday Posted December 12, 2006 Author Share Posted December 12, 2006 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.