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 | |
| $listFrults = array( | |
| 'Pineapple', | |
| 'Cashew', | |
| 'Apple', | |
| 'Strawberry', | |
| 'Pear', | |
| 'Coconut', | |
| 'Grape', |
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 | |
| $listFrults = array( | |
| 'p' => 'Pineapple', | |
| 'c' => 'Cashew', | |
| 'a' => 'Apple' | |
| ); | |
| if (array_key_exists('c', $listFrults)) { | |
| echo 'Chave existente.';//Bloco que será exibido. |
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 | |
| $listFrults = array( | |
| 'p' => 'Pineapple', | |
| 'c' => 'Cashew', | |
| 'a' => 'Apple', | |
| 'o' => 'Orange' | |
| ); | |
| if (array_key_exists('a', $listFrults)) { |
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 | |
| $listFrults = array( | |
| 'pineapple' => 100, | |
| 'cashew' => 900, | |
| 'orange' => 500, | |
| 'strawberry' => 230 | |
| ); | |
| if (in_array('900', $listFrults, true)) { |
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 | |
| $listFrults = array( | |
| 'Pineapple', | |
| 'Cashew', | |
| 'Coconut', | |
| 'Orange', | |
| 'Strawberry' | |
| ); |
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 | |
| $listFrults1 = array( | |
| 'p' => 'Pineapple', | |
| 'c' => 'Cashew', | |
| 'a' => 'Apple', | |
| 'o' => 'Orange' | |
| ); | |
| $listFrults2 = array( | |
| 's' => 'Strawberry', |
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 | |
| $listFrults1 = array('Pineapple', 'Cashew', 'Coconut', 'Orange'); | |
| $listFrults2 = array('Strawberry', 'Pear', 'Grape', 'Peach'); | |
| $listFrults3 = array('Lime', 'Apple', 'Kiwi Fruit', 'Mango'); | |
| $listFullFrults = array_merge($listFrults1, $listFrults2, $listFrults3); | |
| print_r($listFullFrults); |
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 | |
| //Caminhos dos arquivos a serem incluídos. | |
| $path1 = '<path>/filename_1.php'; | |
| $path2 = '<path>/filename_2.php'; | |
| //Usando a função include_once: | |
| include_once($path1); | |
| //O arquivo no $path1 não será incluído, pois ele já foi. | |
| include_once($path1); |
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 a ser incluído. | |
| $path = '<path>/filename.php'; | |
| //Fazendo inclusão do arquivo. | |
| require($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 | |
| //Caminho do arquivo a ser incluído. | |
| $path = '<path>/filename.php'; | |
| //Fazendo inclusão do arquivo. | |
| include($path); |