Advertisement
LightProgrammer000

Funcao [Simples]

Nov 23rd, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.54 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2.  
  3. <html lang="pt-br">
  4.  
  5.     <!-- Cabeçalho -->
  6.     <head>
  7.         <meta charset="utf-8">
  8.         <title> Aula 13 </title>
  9.  
  10.         <!-- Seção CSS -->
  11.         <link rel="stylesheet" href="../_css/estilo.css">
  12.         <style>
  13.             html
  14.             {
  15.                 font-size: 18px;
  16.                 font-style: normal;
  17.                 font-weight: normal;
  18.  
  19.                 color: darkblue;
  20.                 text-shadow: 2px 2px 4px #000000;
  21.             }
  22.  
  23.             button
  24.             {
  25.                 cursor: pointer;
  26.  
  27.                 color: blue;
  28.                 background-color: #4CAF50; /* Green */
  29.  
  30.                 border: none;
  31.                 display: inline-block;
  32.  
  33.                 margin: 40px 190px;
  34.                 padding: 16px 32px;
  35.  
  36.                 font-size: 16px;
  37.                 text-align: center;
  38.                 text-decoration: none;
  39.  
  40.                 transition-duration: 0.4s;
  41.                 -webkit-transition-duration: 0.4s; /* Safari */
  42.             }
  43.  
  44.             .button1
  45.             {
  46.                 border: 2px solid #4CAF50;
  47.  
  48.                 color: black;
  49.                 background-color: white;
  50.             }
  51.  
  52.             .button1:hover
  53.             {
  54.                 color: white;
  55.                 background-color: #4CAF50;
  56.             }
  57.  
  58.             span#a
  59.             {
  60.                 color: red;
  61.                 margin-left: 10px;
  62.             }
  63.  
  64.             span#b
  65.             {
  66.                 color:black;
  67.             }
  68.         </style>
  69.     </head>
  70.  
  71. <!-- Corpo -->
  72. <body>
  73.  
  74. <div>  
  75.  
  76. <?php
  77.  
  78. # Supressão de erros
  79. error_reporting(0);
  80.  
  81. # Variáveis
  82. $a = 3;
  83.  
  84. # Função: Passagem de parâmetros por referência
  85. // Qualquer alteração em "X" altera o valor de "A"
  86. function teste(&$x)
  87. {
  88.     $x += 2;
  89.  
  90.     return($x);
  91. }
  92. echo "<br>";
  93. echo "<span id='a'> X </span> : " . "<span id='b'>" . teste($a) . "</span>" . "<br>";
  94. echo "<span id='a'> A </span> : " . "<span id='b'>" . $a . "</span>" . "<br>";
  95.  
  96. ?>
  97.  
  98. </div>
  99.  
  100. </body>
  101.  
  102. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement