Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Talk:PHP Programming/Arrays

Page contents not supported in other languages.
Add topic
From Wikibooks, open books for an open world
<Talk:PHP Programming
Latest comment:10 years ago by Sae1962 in topicExample #3 HTML rendering

You haven't explained what

while (list($key, $val) = each($accessories)) {

does yet. Try to use only code that you've already shown. People who are just learning (like myself) need to be able to follow it, appending one thing at a time to their knowledge. -Omegatron 20:59, 24 Jun 2005 (UTC)

Array Examples

[edit source]

Somebody changed examples from <b>Toyota</b> to '''Toyota''' .THIS IS INVALIDWE ARE NOT EVALUATING HTML HERE!!!PHP IS JUST A SCRIPT INTERPRETER, OUTPUTTING DATA. IT DOESN'T OUTPUT BOLD TEXT, DOES IT?Wykis18:13, 22 March 2006 (UTC)Reply


the BOLD tag elementdoes exist in XHTML.w3

Added the missing </b> closing tags for model, color, and year.71.110.195.2119:26, 1 May 2006 (UTC) Randall - whizman.com - 2006/05/01Reply

Example 3

[edit source]

I think that it wasn't explained in any page so far the curly braces in double-quoted strings notation for using variables... It's very confusing if you don't know it yet. They should be either replaced for . concatenating, or an explanation of how they work should be added below the example. -Roma emu15:41, 7 September 2006 (UTC)Reply

Example #3 HTML rendering

[edit source]

The third example

<?phpecho"Manufacturer:{$array['name']}\n";echo"Brand: &lt;b&gt;{$array2['1']}&lt;/b&gt;&lt;br /&gt;\n";echo"Colour: &lt;b&gt;".$array3['colour']."&lt;/b&gt;&lt;br /&gt;\n";echo"Year Manufactured: &lt;b&gt;".$array3[1]."&lt;/b&gt;&lt;br /&gt;\n"?>

is output in both Google Chrome 39.0.2171.99 m (64-bit) & Microsoft Internet Explorer 11.0.9600.17498 (64-bit) as

Manufacturer: Toyota Brand: <b>Celica</b><br /> Colour: <b>black</b><br /> Year Manufactured: <b>1991</b><br />

In other words, the commands between the ampercent and the semicolon is not executed, like it is the case for the carriage return. If these commands are converted to text,

<?phpecho"Manufacturer:{$array['name']} <br />";echo"Brand: <b>{$array2['1']}</b><br />";echo"Colour: <b>".$array3['colour']."</b><br />";echo"Year Manufactured: <b>".$array3[1]."</b><br />"?>

it works in these browsers properly. The same is true for the multidimensional array example.--Sae1962 (discusscontribs)13:44, 21 January 2015 (UTC)Reply

Retrieved from "https://en.wikibooks.org/w/index.php?title=Talk:PHP_Programming/Arrays&oldid=4409684"
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp