Created
December 26, 2012 02:21
-
-
Save imduffy15/4377342 to your computer and use it in GitHub Desktop.
Extract mobile numbers
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
foreach($vCard as $vCardPart) { | |
if(isset($vCardPart->n[0]['FirstName']) && isset($vCardPart->tel[0]['Value'])) { | |
$number = $vCardPart->tel[0]['Value']; | |
$number = str_replace("-","",$number); | |
$number = str_replace("00353","0",$number); | |
$number = str_replace("+353","0",$number); | |
if( | |
substr($number,0,3) == "086" || | |
substr($number,0,3) == "087" || | |
substr($number,0,3) == "083" || | |
substr($number,0,3) == "085" || | |
substr($number,0,3) == "089" | |
) { | |
$firstname = $vCardPart->n[0]['FirstName']; | |
echo($firstname . ": "); | |
echo($number); | |
echo("\n"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment