File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed
Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -109,15 +109,38 @@ unset($vcard->FN);
109109isset($vcard->FN);
110110```
111111
112- ### Manipulating parameters
112+ ### Working with parameters
113+
114+ To get access to a parameter, you can simply use array-access:
115+
116+ ``` php
117+ $type = $vcard->TEL['TYPE']:
118+ echo (string)$type;
119+ ```
120+
121+ Parameters can also appear multiple times. To get to their values, just loop
122+ through them:
123+
124+ ``` php
125+ if ($param = $vcard->TEL['TYPE']) {
126+ foreach($param as $value) {
127+ echo $value, "\n";
128+ }
129+ }
130+ ```
113131
114132To change parameters for properties, you can use array-access syntax:
115133
116134``` php
117135<?php
118136
119- $tel = $vcard->FN;
120- $tel['TYPE'] = ['WORK','FAX']:
137+ $vcard->TEL['TYPE'] = ['WORK','FAX']:
138+ ```
139+
140+ Or when you're working with singular parameters:
141+
142+ ``` php
143+ $vcard->TEL['PREF'] = 1;
121144```
122145
123146### Parsing vCard or iCalendar
You can’t perform that action at this time.
0 commit comments