File_IMC
[ class tree: File_IMC ] [ index: File_IMC ] [ all elements ]

Class: File_IMC_Parse_Vcard

Source Location: /File_IMC-0.4.0/File/IMC/Parse/Vcard.php

Class Overview

File_IMC_Parse
   |
   --File_IMC_Parse_Vcard

This class is a parser for vCards.


Author(s):

Methods


Inherited Variables

Inherited Methods

Class: File_IMC_Parse

File_IMC_Parse::convertLineEndings()
Converts line endings in text.
File_IMC_Parse::fromFile()
Reads a file for parsing, then sends it to $this->fromText() and returns the results.
File_IMC_Parse::fromText()
Prepares a block of text for parsing, then sends it through and returns the results from $this->_fromArray().
File_IMC_Parse::splitByColon()
Splits the line into types/parameters and values.
File_IMC_Parse::splitByComma()
Splits a string into an array at commas.
File_IMC_Parse::splitByDelim()
Splits a string into an array. Honors backslash-escaped delimiters, (i.e., splits at ';' not '\;') and double-quotes (will not break inside double-quotes ("")).
File_IMC_Parse::splitBySemi()
Splits a string into an array at semicolons.
File_IMC_Parse::unescape()
Used to make string human-readable after being a vCard value.

Class Details

[line 82]
This class is a parser for vCards.

Parses vCard 2.1 and 3.0 sources from file or text into a structured array.

Usage:

  1.      // include this class file
  2.      require_once 'File/IMC.php';
  3.  
  4.      // instantiate a parser object
  5.      $parse = new File_IMC::parse('vCard');
  6.  
  7.      // parse a vCard file and store the data
  8.      // in $cardinfo
  9.      $cardinfo $parse->fromFile('sample.vcf');
  10.  
  11.      // view the card info array
  12.      echo '<pre>';
  13.      print_r($cardinfo);
  14.      echo '</pre>';



[ Top ]


Method Detail

_parseADR   [line 126]

array _parseADR( string $text)

Parses a vCard line value identified as being of the "ADR" (structured address) type-defintion.
  • Return: An array of key-value pairs where the key is the portion-name and the value is the portion-value. The value itself may be an array as well if multiple comma-separated values were indicated in the vCard source.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]

_parseCATEGORIES   [line 195]

mixed _parseCATEGORIES( string $text)

Parses a vCard line value identified as being of the "CATEGORIES" (card-category) type-defintion.
  • Return: An array of categories.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]

_parseGEO   [line 212]

mixed _parseGEO( string $text)

Parses a vCard line value identified as being of the "GEO" (geographic coordinate) type-defintion.
  • Return: An array of lat-lon geocoords.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]

_parseN   [line 98]

array _parseN( string $text)

Parses a vCard line value identified as being of the "N" (structured name) type-defintion.
  • Return: An array of key-value pairs where the key is the portion-name and the value is the portion-value. The value itself may be an array as well if multiple comma-separated values were indicated in the vCard source.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]

_parseNICKNAME   [line 153]

array _parseNICKNAME( string $text)

Parses a vCard line value identified as being of the "NICKNAME" (informal or descriptive name) type-defintion.
  • Return: An array of nicknames.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]

_parseORG   [line 172]

array _parseORG( string $text)

Parses a vCard line value identified as being of the "ORG" (organizational info) type-defintion.
  • Return: An array of organizations; each element of the array is itself an array, which indicates primary organization and sub-organizations.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:32:03 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.