This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Array de elemento de String | |
| $myArray = array( | |
| 'item_1', | |
| 'item_2', | |
| 'item_3', | |
| 'item_4', | |
| 'item_5', | |
| 'item_6', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Array de elemento de String | |
| $myArray = array( | |
| 'item_1', | |
| 'item_2', | |
| 'item_3', | |
| 'item_4', | |
| 'item_5', | |
| 'item_6', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Array de elemento de String | |
| $myArray = array( | |
| 'item_1', | |
| 'item_2', | |
| 'item_3', | |
| 'item_4', | |
| 'item_5', | |
| 'item_6', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $firstArray = array( | |
| 'r' => 'Red', | |
| 'b' => 'Blue', | |
| 'y' => 'Yellow', | |
| ); | |
| $secondArray = array( | |
| 'b' => 'Black', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $firstArray = array( | |
| 'b' => 'Black', | |
| 'w' => 'White', | |
| 'g' => 'Gray', | |
| ); | |
| $secondArray = array( | |
| 'g' => 'Gray', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $firstArray = array( | |
| 'b' => 'Black', | |
| 'w' => 'White', | |
| 'g' => 'Gray', | |
| 'p' => 'pink', | |
| ); | |
| $secondArray = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $myArray = array(); | |
| //Adicionando elementos a nosso Array dinamicamente, | |
| //sem definir sua chave, assim ela será gerada automaticamente: | |
| $myArray[] = 'blue'; | |
| $myArray[] = 'red'; | |
| //Adicionado elementos definindo sua chave de acesso: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Caminho do arquivo | |
| $path = '../my_folder_name/my_filename.php'; | |
| //Retornará true se o arquivo existir | |
| if (file_exists($path)) { | |
| //Se o arquivo existir podemos incluí-lo. | |
| include($path); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Pegando o caminho relativo à esse arquivo. | |
| $path = 'components/'; | |
| $file = $path . 'header.php'; | |
| include($file); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $path = dirname(__FILE__) . '\components\\'; | |
| //Ou também: | |
| //$path = __DIR__ . '\components\\'; | |
| $file = $path . 'header.php'; | |
| include($file); |