array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'function.is-executable.php', 1 => 'is_executable', ), 'up' => array ( 0 => 'ref.filesystem.php', 1 => 'Funciones del Sistema de Archivos', ), 'prev' => array ( 0 => 'function.is-dir.php', 1 => 'is_dir', ), 'next' => array ( 0 => 'function.is-file.php', 1 => 'is_file', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'es', 'path' => 'reference/filesystem/functions/is-executable.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
is_executable — Indica si el nombre de archivo es ejecutable
filename
Ruta del archivo.
Devuelve true
si el nombre de archivo existe y es ejecutable, o false
si se produjo un
error.
Ejemplo #1 Ejemplo de is_executable()
<?php
$archivo = '/home/vincent/archivo.sh';
if (is_executable($archivo)) {
echo $archivo.' es ejecutable';
} else {
echo $archivo.' no es ejecutable';
}
?>
En caso de fallo, se emite un E_WARNING
.
Nota: Los resultados de esta función son guardados en caché. Para más información ver clearstatcache().
Desde PHP 5.0.0, esta función también puede usarse con algunos URL wrappers. Consultar Protocolos y Envolturas soportados para deter4minar qué envolturas soportan la familia de funcionalidad de stat().