--- In [email protected], "Mike Franks" <[EMAIL PROTECTED]> wrote:

> 
> Actually, what I was trying do say (and didn't say very well) is that I
> don't see what you're actually trying to accomplish with your
> foreach() loop.
> 
> Unless you *use* the result of each iteration through the loop
within the
> body of the loop (print it, store it to some other structure, etc.), all
> you're really doing is assigning $val (or $a, in your modified example)
> based on the *last* element in your array.
> 
> Mike
> 
> P.S. I believe Pete correctly identified the cause of your error
message.
>

Yep, Pete got it. I knew it was something mundane like that and I just
needed a second pair of eyes to pick it out. Also, I figured out what
I was doing wrong with the foreach loop. This is what I should have
been using all along:

foreach ($outarr as $key => $val) {
   if(strpos($val,"http://";) === 0){
      $outarr[$key] = '<a href="' . $val . '">' . $val . '</a>';
   }elseif(strpos($val,"ftp://";) === 0){
      $outarr[$key] = '<a href="' . $val . '">' . $val . '</a>';
   }else{
      //do nothing
   }
}

Thanks for your help, you too Pete.
-Nick




Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php-list/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to