https://wiki.cabal.mx/index.php?title=Curso_b%C3%A1sico_de_PHP/Arreglo_12&feed=atom&action=history
Curso básico de PHP/Arreglo 12 - Historial de revisiones
2024-03-29T13:18:30Z
Historial de revisiones para esta página en el wiki
MediaWiki 1.32.1
https://wiki.cabal.mx/index.php?title=Curso_b%C3%A1sico_de_PHP/Arreglo_12&diff=131902&oldid=prev
Rrc: /* Arreglo12 */
2021-03-14T11:31:26Z
<p><span dir="auto"><span class="autocomment">Arreglo12</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="es">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Revisión anterior</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revisión del 11:31 14 mar 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l17" >Línea 17:</td>
<td colspan="2" class="diff-lineno">Línea 17:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> <?php</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> <?php</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo = array();</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo = array();</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<del class="diffchange diffchange-inline">{</del>'0'<del class="diffchange diffchange-inline">} </del>= 'Caracas';</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<ins class="diffchange diffchange-inline">[</ins>'0'<ins class="diffchange diffchange-inline">] </ins>= 'Caracas';</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<del class="diffchange diffchange-inline">{</del>'Caracas'<del class="diffchange diffchange-inline">} </del>= 'Venezuela';</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<ins class="diffchange diffchange-inline">[</ins>'Caracas'<ins class="diffchange diffchange-inline">] </ins>= 'Venezuela';</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<del class="diffchange diffchange-inline">{</del>'1'<del class="diffchange diffchange-inline">} </del>= 'Guadalajara';</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<ins class="diffchange diffchange-inline">[</ins>'1'<ins class="diffchange diffchange-inline">] </ins>= 'Guadalajara';</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<del class="diffchange diffchange-inline">{</del>'Guadalajara'<del class="diffchange diffchange-inline">} </del>= 'Mexico';</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<ins class="diffchange diffchange-inline">[</ins>'Guadalajara'<ins class="diffchange diffchange-inline">] </ins>= 'Mexico';</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<del class="diffchange diffchange-inline">{</del>'2'<del class="diffchange diffchange-inline">} </del>= 'Paris';</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<ins class="diffchange diffchange-inline">[</ins>'2'<ins class="diffchange diffchange-inline">] </ins>= 'Paris';</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<del class="diffchange diffchange-inline">{</del>'Paris'<del class="diffchange diffchange-inline">} </del>= 'Francia';</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<ins class="diffchange diffchange-inline">[</ins>'Paris'<ins class="diffchange diffchange-inline">] </ins>= 'Francia';</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<del class="diffchange diffchange-inline">{</del>'3'<del class="diffchange diffchange-inline">} </del>= 'Tokyo';</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<ins class="diffchange diffchange-inline">[</ins>'3'<ins class="diffchange diffchange-inline">] </ins>= 'Tokyo';</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<del class="diffchange diffchange-inline">{</del>'Tokyo'<del class="diffchange diffchange-inline">} </del>= 'Japon';</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $CiudadInfo<ins class="diffchange diffchange-inline">[</ins>'Tokyo'<ins class="diffchange diffchange-inline">] </ins>= 'Japon';</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> function CiudadParaNum ( $IndexNum, $CiudadAreglo )</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> function CiudadParaNum ( $IndexNum, $CiudadAreglo )</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> {</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> {</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> if( isset( $CiudadAreglo<del class="diffchange diffchange-inline">{</del>$IndexNum<del class="diffchange diffchange-inline">} </del>) )</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> if( isset( $CiudadAreglo<ins class="diffchange diffchange-inline">[</ins>$IndexNum<ins class="diffchange diffchange-inline">] </ins>) )</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> {</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> {</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $LaCiudad = $CiudadAreglo<del class="diffchange diffchange-inline">{</del>$IndexNum<del class="diffchange diffchange-inline">}</del>;</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $LaCiudad = $CiudadAreglo<ins class="diffchange diffchange-inline">[</ins>$IndexNum<ins class="diffchange diffchange-inline">]</ins>;</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $ElPais = $CiudadAreglo<del class="diffchange diffchange-inline">{</del>$LaCiudad<del class="diffchange diffchange-inline">}</del>;</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $ElPais = $CiudadAreglo<ins class="diffchange diffchange-inline">[</ins>$LaCiudad<ins class="diffchange diffchange-inline">]</ins>;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> print( "$LaCiudad se encuentra en $ElPais<br />" );</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> print( "$LaCiudad se encuentra en $ElPais<br />" );</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> }</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> }</div></td></tr>
</table>
Rrc
https://wiki.cabal.mx/index.php?title=Curso_b%C3%A1sico_de_PHP/Arreglo_12&diff=121694&oldid=prev
Rrc en 04:51 12 sep 2016
2016-09-12T04:51:40Z
<p></p>
<p><b>Página nueva</b></p><div>__NOTOC__<br />
* [[:#Arreglo12 | Arreglo 12]]<br />
** [[:#Contenidos de Cabeza5.inc | Contenidos de Cabeza5.inc]]<br />
** [[:#Contenidos de incPie5.php | Contenidos de incPie5.php]]<br />
** [[:#Contenidos de clase.css | Contenidos de clase.css]]<br />
** [[:#Explicación | Explicación]]<br />
** [[:#Ejecutarlo | Ejecutarlo]]<br />
** [[:#Descargarlo | Descargarlo]]<br />
<br />
== Arreglo12 ==<br />
<br />
<syntaxhighlight lang="php" line="GESHI_FANCY_LINE_NUMBERS"><br />
<?php<br />
require_once( "Cabeza5.inc" );<br />
?><br />
<body><br />
<?php<br />
$CiudadInfo = array();<br />
$CiudadInfo{'0'} = 'Caracas';<br />
$CiudadInfo{'Caracas'} = 'Venezuela';<br />
$CiudadInfo{'1'} = 'Guadalajara';<br />
$CiudadInfo{'Guadalajara'} = 'Mexico';<br />
$CiudadInfo{'2'} = 'Paris';<br />
$CiudadInfo{'Paris'} = 'Francia';<br />
$CiudadInfo{'3'} = 'Tokyo';<br />
$CiudadInfo{'Tokyo'} = 'Japon';<br />
<br />
function CiudadParaNum ( $IndexNum, $CiudadAreglo )<br />
{<br />
if( isset( $CiudadAreglo{$IndexNum} ) )<br />
{<br />
$LaCiudad = $CiudadAreglo{$IndexNum};<br />
$ElPais = $CiudadAreglo{$LaCiudad};<br />
print( "$LaCiudad se encuentra en $ElPais<br />" );<br />
}<br />
}<br />
print( "<p class=\"SubTitleFont\"><br />
\$CiudadInfo\" tiene " . count( $CiudadInfo ) . "Elemento(s) <br />
</p><br />
<p class=\"LargeTextFont\">");<br />
<br />
CiudadParaNum( 0, $CiudadInfo );<br />
CiudadParaNum( 1, $CiudadInfo );<br />
CiudadParaNum( 2, $CiudadInfo );<br />
CiudadParaNum( 3, $CiudadInfo );<br />
<br />
print( "</p>" );<br />
require_once( "incPie5.php" );<br />
?><br />
</syntaxhighlight><br />
<br />
=== Contenidos de Cabeza5.inc ===<br />
[http://www.linuxcabal.org/PHPClase/Cabeza5.inc.txt Ver los contenidos de Cabeza5.inc]<br />
<br />
=== Contenidos de incPie5.php ===<br />
[http://www.linuxcabal.org/PHPClase/incPie5.phps Ver los contenidos de incPie5.php]<br />
<br />
=== Contenidos de clase.css ===<br />
[http://www.linuxcabal.org/PHPClase/clase.css.txt Ver los contenidos de clase.css]<br />
<br />
=== Explicación ===<br />
<br />
=== Ejecutarlo ===<br />
[http://www.linuxcabal.org/PHPClase/Array12.php Ejecutar el código de Arreglo 12]<br />
<br />
=== Descargarlo ===<br />
[http://www.linuxcabal.org/PHPClase/Array12.phps Descargar el código de Arreglo 12]<br />
<br />
<br />
[[Category:PHP]]<br />
[[Category:PHPCabal]]<br />
[[Category:CursoPHP]]</div>
Rrc