Re: Array printing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Much simpler:

foreach ($arrText as $text)
{
  print $text;
}

Use that code. Just add in your HTML tags and it will be much cleaner and
faster.

"Michael Conway" <mconway3@cox.net> wrote in message
news:!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAeI4MkiQKXEijmrrs5/EPIcKA
AAAQAAAAy2gHoG3pA0ahA6rNDApxuwEAAAAA@cox.net...
> I am using an array to return the contents of a file. The file root is
> located on the db and the file content is correctly rendered using the
> following code:
>
>
>
> echo "\n\t<td ALIGN=LEFT bgcolor = \"silver\">" .
>
> $arrText= file($row["description"]);
>
> for ($i=0; $i<count($arrText); $i++)
>
> {
>
>    echo("<P ALIGN=LEFT><PRE><b>$arrText[$i]</b></PRE></P>");
>
> }
>
>
>
> Everything works fine except that the paragraph is led off by the pesky
> "Array" tag, such as:
>
>
>
> Array
>
> File contents here..
>
>
>
> Is there a way to suppress or hide the Array tag?  I realize that there
> probably is an excruciatingly simple solution, but I have not found it
> yet.
>
>
>
> Thanks.
>
>
>
> Michael Conway
>
> mconway3@cox.net
>
> (703) 968-8875
>
>
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux