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

> 
> Nick - what is the purpose of assigning a value to $val within this
> foreach(), when the foreach is initializing a new $val within itself on
> each iteration?
> 
> I believe you'll have much greater success if you use a different
> variable on the left side of those three assignments.
> 
> hth,
> Mike
>

Mike, I don't really follow you here... Do you mean to use a different
variable name and then only reassign itself if a change is made? Like
this:

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

   if ($a != $val){
      $val = $a;
   }
}

Thanks,
-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