Comunidad PHPeros

Lenguajes => PHP => Mensaje iniciado por: alpha en 19 de Septiembre de 2014, 06:50:19 am

Título: ¿qué "define" suelen acompañar casi siempre a la cabecera de vuestros scripts?
Publicado por: alpha en 19 de Septiembre de 2014, 06:50:19 am
Hola, yo siempre suelo comenzar mis scripts con una serie de "define", como la mayoría de mis scripts suelen ser para línea de comandos, utilizo una selección de estos:
Código: [Seleccionar]
<?php
  define
(&#39;NUL&#39;,  &quot;\x00&quot;);  // \x00      Null
  
define(&#39;SOH&#39;,  &quot;\x01&quot;);  // \x01      Start Of Heading
  
define(&#39;STX&#39;,  &quot;\x02&quot;);  // \x02      Start Of Text
  
define(&#39;ETX&#39;,  &quot;\x03&quot;);  // \x03      End Of Text
  
define(&#39;EOT&#39;,  &quot;\x04&quot;);  // \x04      End Of Transmission
  
define(&#39;ENQ&#39;,  &quot;\x05&quot;);  // \x05      Enquiry
  
define(&#39;ACK&#39;,  &quot;\x06&quot;);  // \x06      Acknowledge

  
define(&#39;BEL&#39;,  &quot;\x07&quot;);  // \x07  \a  Bell
  
define(&#39;BS&#39;,  &quot;\x08&quot;);  // \x08  \b  Backspace
  
define(&#39;HT&#39;,  &quot;\x09&quot;);  // \x09  \t  Horizontal Tab
  
define(&#39;LF&#39;,  &quot;\x0A&quot;);  // \x0A  \n  Line feed
  
define(&#39;VT&#39;,  &quot;\x0B&quot;);  // \x0B  \v  Vertical Tab
  
define(&#39;FF&#39;,  &quot;\x0C&quot;);  // \x0C  \f  Form feed
  
define(&#39;CR&#39;,  &quot;\x0D&quot;);  // \x0D  \r  Carriage return

  
define(&#39;SO&#39;,  &quot;\x0E&quot;);  // \x0E      Shift Out
  
define(&#39;SI&#39;,  &quot;\x0F&quot;);  // \x0F      Shift In
  
define(&#39;DLE&#39;,  &quot;\x10&quot;);  // \x10      Data Link Escape
  
define(&#39;DC1&#39;,  &quot;\x11&quot;);  // \x11      Device Control 1 (XON)
  
define(&#39;DC2&#39;,  &quot;\x12&quot;);  // \x12      Device Control 2
  
define(&#39;DC3&#39;,  &quot;\x13&quot;);  // \x13      Device Control 3 (XOFF)
  
define(&#39;DC4&#39;,  &quot;\x14&quot;);  // \x14      Device Control 4
  
define(&#39;NAK&#39;,  &quot;\x15&quot;);  // \x15      Negative Acknowledge
  
define(&#39;SYN&#39;,  &quot;\x16&quot;);  // \x16      Sychronous Idle
  
define(&#39;ETB&#39;,  &quot;\x17&quot;);  // \x17      End of Transmission Block
  
define(&#39;CAN&#39;,  &quot;\x18&quot;);  // \x18      Cancel
  
define(&#39;EM&#39;,  &quot;\x19&quot;);  // \x19      End of Medium
  
define(&#39;SUB&#39;,  &quot;\x1A&quot;);  // \x1A      Substitute
  
define(&#39;ESC&#39;,  &quot;\x1B&quot;);  // \x1B      Escape
  
define(&#39;FS&#39;,  &quot;\x1C&quot;);  // \x1C      File Separator
  
define(&#39;GS&#39;,  &quot;\x1D&quot;);  // \x1D      Group Separator
  
define(&#39;RS&#39;,  &quot;\x1E&quot;);  // \x1E      Record Separator
  
define(&#39;US&#39;,  &quot;\x1F&quot;);  // \x1F      Unit Separator
  
define(&#39;SP&#39;,  &quot;\x20&quot;);  // \x20     Space

  
define(&#39;DEL&#39;,  &quot;\x7F&quot;);  // \x7F      Delete

  
define(&#39;CRLF&#39;, &quot;\r\n&quot;);
?>


¿Cuales soléis utilizar?