Field::isType($type[,$type...])

Version 3.8

Check if field is given type

Return TRUE if field is one of the given types.

Return value

String

Arguments

$type
Fieldtype name
Comma delimited list or array of strings

Full documentation

Show all phone and email -fields:

foreach ( $Order->getFields() as $Field ){
    if ( $Field->isType('phone','email') ){
        $txt .= "{$Field->getTitle()}: {$Field->getValue()}";
    }
}

Note: Previous example could also be made using Page::getFieldsByType() -method:

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