downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Phar::offsetGet> <Phar::mungServer
[edit] Last updated: Fri, 17 May 2013

view this page in

Phar::offsetExists

(PHP >= 5.3.0, PECL phar >= 1.0.0)

Phar::offsetExistsdétermine si un fichier existe dans le phar

Description

bool Phar::offsetExists ( string $offset )

C'est une implémentation de l'interface ArrayAccess qui permet la manipulation directe du contenu d'une archive Phar en utilisant les crochets d'accès au tableau.

offsetExists() est appelé comme isset() est appelé.

Liste de paramètres

offset

Le nom de fichier (en chemin relatif) à chercher dans le Phar.

Valeurs de retour

Retourne TRUE si le fichier existe dans le phar, FALSE sinon.

Exemples

Exemple #1 Un exemple avec Phar::offsetExists()

<?php
$p 
= new Phar(dirname(__FILE__) . '/mon.phar'0'mon.phar');
$p['premierfichier.txt'] = 'premier fichier';
$p['secondfichier.txt'] = 'second fichier';
// les lignes suivantes font appel à offsetExists() de façon indirecte
var_dump(isset($p['premierfichier.txt']));
var_dump(isset($p['pasla.txt']));
?>

L'exemple ci-dessus va afficher :

bool(true)
bool(false)

Voir aussi



add a note add a note User Contributed Notes Phar::offsetExists - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites