Login   Register  
PHP Classes
elePHPant
Icontem

File: example-1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Peter Kahl  >  Extract Name from Email Address  >  example-1.php  >  Download  
File: example-1.php
Role: Example script
Content type: text/plain
Description: Process single address
Class: Extract Name from Email Address
Extract person name from e-mail address header
Author: By
Last change: Added method for email address extraction. Bug fix.
Date: 10 months ago
Size: 653 bytes
 

Contents

Class file image Download
<?php

/**
 *
 * Name Extractor
 * Version:      1.2.0
 * Last Updated: 2013-11-05
 * Copyright (c) 2012-2013 Peter Kahl. All rights reserved. www.colossalmind.com
 * Use of this source code is governed by a GNU General Public License
 * that can be found in the enclosed documentation.
 *
 * https://github.com/peterkahl/name-extractor
 *
 */

// Extract name/email from single email address header

require dirname(__FILE__).'/class.name-extractor.php';

$cmname = new name_extractor();

$email '<johnbutterworth@gmail.com>';

echo 
$cmname->extract_name($email);

echo 
'<br />'

echo $cmname->extract_addr($email);