Función PHP die()
❮ Referencia miscelánea de PHP
Ejemplo
Imprima un mensaje y finalice el script actual:
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or die("Unable to connect to $site");
?>
Definición y uso
La función die() es un alias de la función exit() .
Sintaxis
die(message)
Valores paramétricos
Parameter | Description |
---|---|
message | Required. A message or status number to print before terminating the script. A status number will not be written to the output, just used as the exit status. |
Detalles técnicos
Valor devuelto: | Nada |
---|---|
Versión PHP: | 4+ |
❮ Referencia miscelánea de PHP