[pmwiki-devel] php arrays
dso
dso at moosoft.com
Tue Dec 26 16:18:22 CST 2006
I have a recipe I am working on but my PHP isn't so good.
$width = $vars["width"];
$height = $vars["height"];
$url = $ScriptUrl . "/" . $pagename;
$links[0] = "<input name='langpair' value='en|fr'
title='Français/French' src='france.jpg' height='10' type='image'
width='15'>";
$links[1] = "<input name='langpair' value='en|de'
title='Deutsch/German' src='germany.jpg' height='10' type='image'
width='15'>";
$links[2] = "<input name='langpair' value='en|it'
title='Italiano/Italian' src='italy.jpg' height='10' type='image'
width='15'>";
$links[3] = "<input name='langpair' value='en|pt'
title='Português/Portuguese' src='portugal.jpg' height='10'
type='image' width='15'>";
$links[4] = "<input name='langpair' value='en|es'
title='Español/Spanish' src='spain.jpg' height='10' type='image'
width='15'>";
$links[5] = "<input name='langpair' value='en|ja'
title='日本語/Japanese' src='japan.jpg' height='10'
type='image' width='15'>";
$links[6] = "<input name='langpair' value='en|ko'
title='한국어/Korean' src='korea.jpg' height='10'
type='image' width='15'>";
$links[7] = "<input name='langpair' value='en|zh-CN'
title='中文(简体)/Chinese
Simplified' src='china.jpg' height='10' type='image' width='15'>";
$links[8] = "<input name='langpair' value='en|ar'
title='عربي/Arabic' src='sa.jpg' height='10'
type='image' width='15'>";
$r = "\n<form action='http://www.google.com/translate'
target='_blank'>\n";
$r .= "<input name='u' value='$url' type='hidden' />\n";
$r .= "<input name='hl' value='en' type='hidden'>\n";
$r .= "<input name='ie' value='UTF8' type='hidden'>\n";
$r .= "<table width='100pct' cellpadding='1' cellspacing='0'>\n";
//loop to create table here
$r .= "</table>\n";
$r .= "</form>\n";
How do you create a loop such that the array of links can be output in
an arbitrary fashion based on the width and height given? Thanks!
Daniel
More information about the pmwiki-devel
mailing list