You are here: Re: Include Problem ? « PHP Programming Language « IT news, forums, messages
Re: Include Problem ?

Posted by Captain Paralytic on 10/26/07 11:04

On 26 Oct, 12:01, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Fri, 26 Oct 2007 12:47:44 +0200, Captain Paralytic
>
>
>
>
>
> <paul_laut...@yahoo.com> wrote:
> > On 26 Oct, 10:55, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> >> On Fri, 26 Oct 2007 10:47:45 +0200, Xav <xav...@inbox.com> wrote:
> >> > I did the <pre>...</pre> thing...
> >> > it shows;
>
> >> > [0] => file1.php
> >> > [1] => file2.php
> >> > etc...
>
> >> > as expected!
>
> >> > I think I found a Bug!
>
> >> Not very likely.
> >> Do this:
>
> >> $c = count($content);
> >> for( $x=0; $x<$c; $x++ ){
> >> echo "|{$fileDir}{$content[$x]}|\n";
>
> >> }
>
> >> The pipes are there to discover whitespace, a normal space would account
> >> for the difference. Normally I'd be against using <pre>, just look at
> >> the
> >> source. And please enable error_reporting & display_errors while
> >> developing, and tell us why PHP sais the include fails.
>
> > Surely {$content[$x]} won't work. PHP does only one substitution so
> > {$content[1]} will work but {$content[$x]} doesn't (at least in my
> > experience).
>
> The code:
> <?php
> echo phpversion();
> $foo = array(3 => 'bar');
> $x = 3;
> echo "{$foo[$x]}";
> ?>
> Output:
> 5.2.4bar
>
> The magic is in the braces.
> --
> Rik Wasmus- Hide quoted text -
>
> - Show quoted text -

So would
echo "$foo[$x]";
not work then?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация