hosted by liquidweb


Go Back   Web Hosting Talk : Other Forums : Web Hosting Lounge : PHP Challenge #-3
Reply

Web Hosting Lounge Forum for general conversation, share interests, have a laugh or discuss topics not related to the above or below forums.
Forum Jump

PHP Challenge #-3

Reply Post New Thread In Web Hosting Lounge Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-16-2002, 09:27 AM
filburt1 filburt1 is offline
Web Hosting Master
 
Join Date: Feb 2002
Posts: 698

PHP Challenge #-3


I have a bunch of predefined constants starting with GPERM_ in addition to some other defined constants. How can I take the values of every constant that starts with GPERM_ and make it into a string that looks like value1,value2...valuen?

__________________
Get your web design questions answered: Web Design Forums at http://www.turtletips.com/forums/ ; vBulletin Board of the Month.

Reply With Quote
Sponsored Links
  #2  
Old 08-16-2002, 10:18 AM
filburt1 filburt1 is offline
Web Hosting Master
 
Join Date: Feb 2002
Posts: 698
NM, figured it out (I imploded the array later on):

PHP Code:
echo 'Creating list of user permissions...';
    
$constants get_defined_constants();
    
$perms = array();
    
$current each($constants);
    
define('PERM_PREFIX''GPERM_');
    while (
$current != false)
    {
        if (
substr($current['key'], 0strlen(PERM_PREFIX)) == PERM_PREFIX)
        {
            
array_push($perms$current['value']);
        }
        
$current each($constants);
    }
    echo 
'Done<br>'

__________________
Get your web design questions answered: Web Design Forums at http://www.turtletips.com/forums/ ; vBulletin Board of the Month.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
International Startups Compete for $50,000 Cash, Cloud Credits in Sixth Annual AWS Challenge Web Hosting News 2012-09-14 13:57:37
Data Center Firm ViaWest Sponsors USA Pro Challenge Bike Race Web Hosting News 2012-08-17 11:58:09
SXSW 2012 Trade Show Sees Growth in Hosting Presence Web Hosting News 2012-03-12 14:54:44
Stonesoft Releases Secure Authentication Portal for Cloud Environments Web Hosting News 2011-09-30 17:51:25
Website Owner Challenges US Immigration and Customs Enforcement Domain Seizures in Court Web Hosting News 2011-06-14 15:01:52


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?