Current location: Hot Scripts Forums » Programming Languages » PHP » array problem


array problem

Reply
  #1 (permalink)  
Old 09-09-03, 11:52 PM
bitesize bitesize is offline
Newbie Coder
 
Join Date: Sep 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
array problem

PHP Code:

$rank $site->user->rank
 
while( list(
$key$value) = each($rank) ) 
     
$extra += "boob   ";//" OR LIKE %".$value."%"; 
 
echo $extra

if i echo $value in the while loop it outputs values
but with $extra it will output nothing



Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 09-10-03, 05:52 AM
ermau's Avatar
ermau ermau is offline
Wannabe Coder
 
Join Date: Aug 2003
Location: Florida, USA
Posts: 240
Thanks: 0
Thanked 0 Times in 0 Posts
Because you're doing it wrong, you don't use + to add on to a string, this isn't javascript

PHP Code:

$extra .= 'boob        '
You use . to append in PHP.
__________________
PHP / mySQL Developer
Reply With Quote
  #3 (permalink)  
Old 09-10-03, 08:08 AM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
Another example:

Quote:
$a = 3;
$a += 5; // sets $a to 8, as if we had said: $a = $a + 5;
$b = "Hello ";
$b .= "There!"; // sets $b to "Hello There!", just like $b = $b . "There!";
http://www.zend.com/manual/language....assignment.php
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multidimensional Array Sorting Kage PHP 6 12-12-05 04:19 PM
Javascript vs PHP, problem with arrays Chuff JavaScript 0 10-03-03 04:01 AM
move array element up or down Perry JavaScript 4 09-27-03 04:23 PM
jpGraph axis labeling problem Squeezer PHP 2 08-20-03 07:53 AM
asp: values in array not in order?? seala ASP 0 08-16-03 12:06 PM


All times are GMT -5. The time now is 06:59 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.