note 110557 deleted from function.pathinfo by danbrown

From: Date: Thu, 06 Dec 2012 14:22:47 +0000
Subject: note 110557 deleted from function.pathinfo by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-192331@lists.php.net to get a copy of this message
Note Submitter: Andy99 ---- Previous regex exapmle provided by Pietro Baricco with more sugar and result clarity. <?php preg_match('~(?:(.*?([^/\\\\]*?))/)?(?:(([^/\\\\]*?)(?:\.([^\./\\\\]*?))?)/?)$~i', $path, $match); ?> Now: $match[1] - dirname, $match[2] - name of parent directory $match[3] - basename $match[4] - filename $match[5] - extension (if present)

« previous php.notes (#192331) next »