SPLIT

From: Date: Tue, 26 Dec 2000 19:03:56 +0000
Subject: SPLIT
Groups: php.general 
Request: Send a blank email to php-general+get-31867@lists.php.net to get a copy of this message
Hi, Here is a newbie question... I have a variable called $textfield with the following data: username username@domain.dom username2 username@domain2.dom I want to awk out the first column so I tried using this: $AWKED=preg_split("/[\s]+/", $textfiled); Now I want to just print out the first column and append foo.com to it. username@foo.com $AWKED[0]@foo.com so i tried this.. for($index = 0;$index < count($AWKED); $index++) { print ("$AWKED[$index]@blah.org\n"); } but that gives me both column 1 and column 2. Can anyone help me with this? Thanks you. --- Vinay Bharel vinay@bharel.com

« previous php.general (#31867) next »