View Single Post
Old 03-04-2008, 08:58 PM   #7 (permalink)
ReSpawN
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

Indeed Xenon, or
PHP Code:
define (_TALK_PHP'TalkPHP');
if ( 
defined _TALK_PHP ) ) { echo 'Defined'; } 
Make a function for defining those things I guess. There is a better way tho.
PHP Code:
    
    $lang 
= array();
    
$lang[] = 'talkphp';
    
$lang[] = 'talkPHP';
    
    function 
pushWord($word) {
        global 
$lang;
        if ( !
in_array($word$lang) ) {
            
array_push($lang$word);
            echo 
'Added to the list!';
        } else {
            echo 
$word.' is already in the array!';
        }
    }
    
    
pushWord('talkPHP');
    
    echo 
'<br><br>Your content of the $lang array:<br><br>';
    
    foreach (
$lang as $key => $value) {
        echo 
$value.'<br>';
    } 
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
The Following User Says Thank You to ReSpawN For This Useful Post:
Orc (03-05-2008)