This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$l = array( 'a apple is a fruit', 'a banana is also a fruit' ); | |
foreach( $l as $s ) { | |
$s = preg_replace( '/(^| )a ([aeiouAEIOU])/', '$1an $2', $s ); | |
echo $s . "\n"; | |
} | |
# outputs | |
an apple is a fruit | |
a banana is also a fruit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Removes items from an array where key information is missing. Useful in | |
* dynamic add situations. | |
*/ | |
$this->data['Date'] = Set::extract( '/Date[start=/\S+/][end=/\S+/]/.', $this->data ); |
NewerOlder