Page::getFieldsByType($type[,$type,...])

Version 4

Get all fields of given type

Get all page fields that are of a certain type.

Return value

Array Array of Field

Arguments

$type
1. String: Type names in comma delimited string.
2. Array: List of type names.

Full documentation

Show all phone and email -fields:

foreach ( $Order->getFieldsByType('phone','email') as $Field ){
    $txt .= "{$Field->getTitle()}: {$Field->getValue()}</p>";
}