1816
Manuale PHP Stig Sæther Bakken Alexander Aulbach Egon Schmid Jim Winstead Lars Torben Wilson Rasmus Lerdorf Andrei Zmievski Jouni Ahto A cura di Luca Perugini Simone Cortesi

[E book ita] php manual

Embed Size (px)

Citation preview

  1. 1. Manuale PHP Stig Sther Bakken Alexander Aulbach Egon Schmid Jim Winstead Lars Torben Wilson Rasmus Lerdorf Andrei Zmievski Jouni Ahto A cura di Luca Perugini Simone Cortesi
  2. 2. Tradotto con la collaborazione di: Marco Cucinato Massimo Colombo Marco De Nittis Darvin Andrioli Fabio Gandola Sergio Marchesini Alan DAngelo Giacomo Tesio Marco Spisto Gabriele Scaroni Mariano Calandra Rocco Curcio Luca Costantino 21-05-2002 Copyright 1997, 1998, 1999, 2000, 2001, 2002 Gruppo di Documentazione PHP Copyright Questo manuale Copyright 1997, 1998, 1999, 2000, 2001, 2002 del Gruppo di Documentazione PHP. I membri di questo gruppo sono elencati nella copertina di questo manuale. Questo manuale pu essere redistribuito secondo i termini della GNU General Public License come pubblicata dalla Free Software Foundation; sia la versione 2 della licenza, oppure (a scelta) qualsiasi versione successiva. La sezione Estendere PHP 4.0 di questo manuale copyright 2000 della Zend Technologies, Ltd. Questo materiale pu essere distribuito solo secondo i termini e le condizioni della Open Publication License, v1.0 o successiva (la versione pi recente al momento disponibile qui http://www.opencontent.org/openpub/).
  3. 3. Manuale PHP Stig Sther Bakken, Alexander Aulbach, Egon Schmid, Jim Winstead, Lars Torben Wilson, Rasmus Lerdorf, Andrei Zmievski, e Jouni Ahto A cura di Luca Perugini A cura di Simone Cortesi Tradotto con la collaborazione di: Marco Cucinato Massimo Colombo Marco De Nittis Darvin Andrioli Fabio Gandola Sergio Marchesini Alan DAngelo Giacomo Tesio Marco Spisto Gabriele Scaroni Mariano Calandra Rocco Curcio Luca Costantino Pubblicato 21-05-2002 Copyright 1997, 1998, 1999, 2000, 2001, 2002 Gruppo di Documentazione PHP Copyright Questo manuale Copyright 1997, 1998, 1999, 2000, 2001, 2002 del Gruppo di Documentazione PHP. I membri di questo gruppo sono elencati nella copertina di questo manuale. Questo manuale pu essere redistribuito secondo i termini della GNU General Public License come pubblicata dalla Free Software Foundation; sia la versione 2 della licenza, oppure (a scelta) qualsiasi versione successiva. La sezione Estendere PHP 4.0 di questo manuale copyright 2000 della Zend Technologies, Ltd. Questo materiale pu essere distribuito solo secondo i termini e le condizioni della Open Publication License, v1.0 o successiva (la versione pi recente al momento disponibile qui http://www.opencontent.org/openpub/).
  4. 4. Sommario Prefazione .............................................................................................................................................i I. Guida Rapida...................................................................................................................................1 1. Introduzione ............................................................................................................................1 Che cos il PHP?..............................................................................................................2 What can PHP do?.............................................................................................................2 A brief history of PHP.......................................................................................................4 2. Installazione ............................................................................................................................5 General Installation Considerations ..................................................................................6 Unix/HP-UX installs .........................................................................................................6 Unix/Linux installs............................................................................................................8 Using Packages ........................................................................................................8 Unix/Mac OS X installs.....................................................................................................8 Using Packages ........................................................................................................8 Compiling for OS X server......................................................................................8 Compiling for MacOS X client..............................................................................10 Unix/OpenBSD installs ...................................................................................................10 Using Ports.............................................................................................................11 Using Packages ......................................................................................................11 Unix/Solaris installs.........................................................................................................11 Required software ..................................................................................................11 Using Packages ......................................................................................................12 Installation on UNIX systems .........................................................................................12 Apache Module Quick Reference..........................................................................12 Building .................................................................................................................13 Installation on Windows systems ....................................................................................13 Windows InstallShield ...........................................................................................13 Manual Installation Steps.......................................................................................14 Building from source .............................................................................................16 Preparations..................................................................................................16 Putting it all together....................................................................................17 Compiling.....................................................................................................18 Installation of Windows extensions .......................................................................18 Servers-CGI/Commandline .............................................................................................20 Testing....................................................................................................................21 Benchmarking........................................................................................................21 Servers-Apache................................................................................................................21 Details of installing PHP with Apache on Unix ....................................................21 Installing PHP on Windows with Apache 1.3.x.....................................................24 Servers-Caudium .............................................................................................................25 Servers-fhttpd ..................................................................................................................25 Servers-IIS/PWS..............................................................................................................26 Windows and PWS/IIS 3 .......................................................................................26 Windows and PWS 4 or newer ..............................................................................27 Windows NT/2000/XP and IIS 4 or newer............................................................27 Servers-Netscape and iPlanet ..........................................................................................28 Installing PHP with Netscape on Sun Solaris........................................................28 Installing PHP with Netscape on Windows ...........................................................31 Servers-OmniHTTPd Server ...........................................................................................32 OmniHTTPd 2.0b1 and up for Windows...............................................................32 iv
  5. 5. Servers-Oreilly Website Pro ............................................................................................33 Oreilly Website Pro 2.5 and up for Windows ........................................................33 Servers-Xitami.................................................................................................................33 Xitami for Windows...............................................................................................33 Servers-Other web servers...............................................................................................34 Problems? ........................................................................................................................34 Read the FAQ.........................................................................................................34 Other problems.......................................................................................................34 Bug reports.............................................................................................................34 Complete list of congure options ..................................................................................34 Congure Options in PHP 4 ..................................................................................35 Database options ..........................................................................................35 Graphics options...........................................................................................38 Misc options .................................................................................................39 PHP options..................................................................................................45 Server options...............................................................................................46 XML options ................................................................................................47 3. Conguration ........................................................................................................................48 The conguration le ......................................................................................................49 General Conguration Directives ..........................................................................50 Safe Mode Conguration Directives......................................................................55 Debugger Conguration Directives .......................................................................55 Extension Loading Directives................................................................................56 mSQL Conguration Directives ............................................................................56 Postgres Conguration Directives .........................................................................56 SESAM Conguration Directives..........................................................................57 Sybase Conguration Directives............................................................................57 Sybase-CT Conguration Directives .....................................................................57 Informix Conguration Directives.........................................................................58 BC Math Conguration Directives ........................................................................59 Browser Capability Conguration Directives........................................................59 Multi-Byte String Conguration Directives ..........................................................59 Exif Conguration Directives ................................................................................60 4. Security .................................................................................................................................62 General considerations ....................................................................................................63 Installed as CGI binary....................................................................................................63 Possible attacks......................................................................................................64 Case 1: only public les served .............................................................................64 Case 2: using --enable-force-cgi-redirect...............................................................64 Case 3: setting doc_root or user_dir ......................................................................65 Case 4: PHP parser outside of web tree.................................................................65 Installed as an Apache module........................................................................................66 Filesystem Security .........................................................................................................66 Database Security ............................................................................................................68 Designing Databases..............................................................................................69 Connecting to Database .........................................................................................69 Encrypted Storage Model ......................................................................................69 SQL Injection.........................................................................................................70 Avoiding techniques.....................................................................................73 Error Reporting................................................................................................................74 Using Register Globals....................................................................................................75 User Submitted Data........................................................................................................77 v
  6. 6. Hiding PHP......................................................................................................................77 Keeping Current ..............................................................................................................78 II. Struttura del Linguaggio.............................................................................................................79 5. Sintassi Fondamentale...........................................................................................................79 Modi per uscire dalla modalit HTML............................................................................80 Separazione delle istruzioni.............................................................................................81 Commenti ........................................................................................................................81 6. Types .....................................................................................................................................82 Introduction .....................................................................................................................83 Booleans ..........................................................................................................................83 Syntax ....................................................................................................................83 Converting to boolean............................................................................................84 Integers ............................................................................................................................85 Syntax ....................................................................................................................85 Integer overow .....................................................................................................85 Converting to integer..............................................................................................86 From booleans..............................................................................................86 From oating point numbers........................................................................86 From strings..................................................................................................87 From other types...........................................................................................87 Floating point numbers....................................................................................................87 Strings..............................................................................................................................88 Syntax ....................................................................................................................88 Single quoted................................................................................................88 Double quoted ..............................................................................................89 Heredoc ........................................................................................................89 Variable parsing............................................................................................91 Simple syntax......................................................................................91 Complex (curly) syntax ......................................................................91 String access by character ............................................................................92 Useful functions.....................................................................................................93 String conversion ...................................................................................................93 Arrays ..............................................................................................................................94 Syntax ....................................................................................................................94 Specifying with array().................................................................................94 Creating/modifying with square-bracket syntax ..........................................94 Useful functions.....................................................................................................95 Array dos and donts.............................................................................................95 Why is $foo[bar] wrong?.........................................................................95 So why is it bad then?.........................................................................96 Examples................................................................................................................96 Objects...........................................................................................................................100 Object Initialization .............................................................................................100 Resource ........................................................................................................................100 Freeing resources .................................................................................................100 NULL ............................................................................................................................101 Syntax ..................................................................................................................101 Type Juggling ................................................................................................................101 Type Casting ........................................................................................................102 7. Variables..............................................................................................................................104 Basics.............................................................................................................................105 vi
  7. 7. Predened variables.......................................................................................................106 Variable scope................................................................................................................107 Variable variables ..........................................................................................................110 Variables from outside PHP...........................................................................................110 HTML Forms (GET and POST)..........................................................................111 IMAGE SUBMIT variable names..............................................................112 HTTP Cookies .....................................................................................................112 Environment variables .........................................................................................112 Dots in incoming variable names.........................................................................113 Determining variable types..................................................................................113 8. Costanti ...............................................................................................................................114 Sintassi...........................................................................................................................115 Costanti predenite........................................................................................................116 9. Expressions .........................................................................................................................118 10. Operatori ...........................................................................................................................122 Operatori aritmetici .......................................................................................................123 Operatori di assegnazione..............................................................................................123 Operatori bitwise ...........................................................................................................124 Operatori di confronto ...................................................................................................124 Operatori di controllo errori ..........................................................................................125 Operatori di esecuzione .................................................................................................126 Operatori di incremento/decremento.............................................................................126 Operatori logici..............................................................................................................127 Precedenza degli operatori.............................................................................................128 Operatori di stringa........................................................................................................129 11. Strutture di controllo .........................................................................................................130 if...................................................................................................................................131 else ..............................................................................................................................131 elseif ..........................................................................................................................132 Sintassi alternativa per le strutture di controllo.............................................................132 while ............................................................................................................................133 do..while....................................................................................................................134 for.................................................................................................................................135 foreach........................................................................................................................137 break ............................................................................................................................139 continue......................................................................................................................139 switch ..........................................................................................................................140 declare........................................................................................................................142 Ticks.....................................................................................................................143 return..............................................................................................................................144 require() .........................................................................................................................144 include().........................................................................................................................145 require_once()................................................................................................................149 include_once() ...............................................................................................................149 12. Functions...........................................................................................................................150 User-dened functions...................................................................................................151 Function arguments .......................................................................................................151 Making arguments be passed by reference ..........................................................151 Default argument values ......................................................................................152 Variable-length argument lists .............................................................................153 Returning values............................................................................................................153 old_function .............................................................................................................154 vii
  8. 8. Variable functions..........................................................................................................154 13. Classi e Oggetti .................................................................................................................156 Classi ..........................................................................................................................157 extends........................................................................................................................159 Costruttori ...............................................................................................................160 ::...................................................................................................................................162 parent ..........................................................................................................................163 Serializzare oggetti - oggetti nelle sessioni ...................................................................164 Le funzioni magiche __sleep e __wakeup.................................................................165 Riferimenti allinterno del costruttore...........................................................................166 14. References Explained........................................................................................................170 What References Are.....................................................................................................171 What References Do......................................................................................................171 What References Are Not..............................................................................................172 Passing by Reference.....................................................................................................172 Returning References ....................................................................................................173 Unsetting References.....................................................................................................174 Spotting References.......................................................................................................174 global References..............................................................................................174 $this...................................................................................................................174 III. Caratteristiche..........................................................................................................................175 15. Gestione degli errori..........................................................................................................175 16. Creazione e manipolazione di immagini...........................................................................180 17. Autenticazione HTTP usando PHP...................................................................................182 18. Cookies..............................................................................................................................185 19. Handling le uploads ........................................................................................................187 POST method uploads...................................................................................................188 Common Pitfalls............................................................................................................190 Uploading multiple les ................................................................................................190 PUT method support......................................................................................................191 20. Utilizzo di le remoti ........................................................................................................193 21. Connection handling .........................................................................................................196 22. Connessioni Persistenti ai Database..................................................................................198 23. Modalit sicura (Safe mode).............................................................................................201 Funzioni limitate/disabilitate dalla modalit sicura (safe-mode) ..................................203 24. Using PHP from the command line ..................................................................................207 IV. Guida Funzioni.........................................................................................................................218 I. Funzioni Apache..................................................................................................................218 apache_child_terminate.................................................................................................219 apache_lookup_uri ........................................................................................................219 apache_note ...................................................................................................................220 apache_setenv................................................................................................................220 ascii2ebcdic ...................................................................................................................220 ebcdic2ascii ...................................................................................................................220 getallheaders..................................................................................................................221 virtual.............................................................................................................................221 II. Funzioni di Array ...............................................................................................................222 array...............................................................................................................................223 array_change_key_case.................................................................................................224 array_chunk ...................................................................................................................225 array_count_values........................................................................................................226 viii
  9. 9. array_diff .......................................................................................................................227 array_ll ........................................................................................................................227 array_lter .....................................................................................................................228 array_ip........................................................................................................................229 array_intersect ...............................................................................................................230 array_key_exists ............................................................................................................231 array_keys......................................................................................................................231 array_map......................................................................................................................233 array_merge...................................................................................................................236 array_merge_recursive ..................................................................................................237 array_multisort ..............................................................................................................238 array_pad .......................................................................................................................239 array_pop.......................................................................................................................240 array_push .....................................................................................................................241 array_rand......................................................................................................................241 array_reduce ..................................................................................................................242 array_reverse .................................................................................................................243 array_search...................................................................................................................244 array_shift......................................................................................................................244 array_slice......................................................................................................................245 array_splice....................................................................................................................246 array_sum ......................................................................................................................247 array_unique..................................................................................................................247 array_unshift..................................................................................................................249 array_values...................................................................................................................249 array_walk .....................................................................................................................250 arsort..............................................................................................................................252 asort ...............................................................................................................................253 compact..........................................................................................................................253 count ..............................................................................................................................254 current............................................................................................................................255 each................................................................................................................................256 end .................................................................................................................................257 extract ............................................................................................................................257 in_array..........................................................................................................................259 key .................................................................................................................................261 krsort..............................................................................................................................261 ksort...............................................................................................................................262 list ..................................................................................................................................263 natcasesort .....................................................................................................................264 natsort ............................................................................................................................264 next ................................................................................................................................265 pos..................................................................................................................................266 prev................................................................................................................................266 range ..............................................................................................................................266 reset................................................................................................................................267 rsort................................................................................................................................268 shufe ............................................................................................................................268 sizeof..............................................................................................................................269 sort.................................................................................................................................269 uasort .............................................................................................................................270 uksort.............................................................................................................................270 ix
  10. 10. usort...............................................................................................................................271 III. Funzioni Aspell [deprecated]............................................................................................275 aspell_check ..................................................................................................................276 aspell_check_raw...........................................................................................................276 aspell_new .....................................................................................................................276 aspell_suggest................................................................................................................277 IV. Funzioni Matematiche BCMath a precisione arbitraria....................................................278 bcadd..............................................................................................................................279 bccomp ..........................................................................................................................279 bcdiv ..............................................................................................................................279 bcmod ............................................................................................................................279 bcmul.............................................................................................................................279 bcpow.............................................................................................................................280 bcscale ...........................................................................................................................280 bcsqrt .............................................................................................................................280 bcsub..............................................................................................................................280 V. Funzioni di compressione Bzip2........................................................................................282 bzclose ...........................................................................................................................284 bzcompress ....................................................................................................................284 bzdecompress ................................................................................................................284 bzerrno...........................................................................................................................285 bzerror............................................................................................................................285 bzerrstr...........................................................................................................................286 bzush............................................................................................................................286 bzopen............................................................................................................................286 bzread ............................................................................................................................287 bzwrite ...........................................................................................................................287 VI. Funzioni Calendar.............................................................................................................289 cal_days_in_month........................................................................................................291 cal_from_jd....................................................................................................................291 cal_info..........................................................................................................................291 cal_to_jd ........................................................................................................................291 easter_date .....................................................................................................................291 easter_days ....................................................................................................................292 FrenchToJD ...................................................................................................................293 GregorianToJD ..............................................................................................................293 JDDayOfWeek...............................................................................................................293 JDMonthName ..............................................................................................................294 JDToFrench ...................................................................................................................295 JDToGregorian ..............................................................................................................295 JDToJewish....................................................................................................................295 JDToJulian.....................................................................................................................295 jdtounix..........................................................................................................................295 JewishToJD....................................................................................................................295 JulianToJD.....................................................................................................................296 unixtojd..........................................................................................................................296 VII. Funzioni API CCVS........................................................................................................297 ccvs_add ........................................................................................................................298 ccvs_auth .......................................................................................................................298 ccvs_command ..............................................................................................................298 ccvs_count .....................................................................................................................298 ccvs_delete ....................................................................................................................299 x
  11. 11. ccvs_done ......................................................................................................................299 ccvs_init.........................................................................................................................299 ccvs_lookup...................................................................................................................300 ccvs_new .......................................................................................................................300 ccvs_report ....................................................................................................................300 ccvs_return ....................................................................................................................301 ccvs_reverse...................................................................................................................301 ccvs_sale........................................................................................................................301 ccvs_status.....................................................................................................................301 ccvs_textvalue ...............................................................................................................302 ccvs_void.......................................................................................................................302 VIII. Funzioni di supporto COM per Windows ......................................................................303 COM..............................................................................................................................306 VARIANT......................................................................................................................307 com_addref....................................................................................................................308 com_get .........................................................................................................................308 com_invoke....................................................................................................................308 com_isenum...................................................................................................................309 com_load .......................................................................................................................309 com_load_typelib ..........................................................................................................309 com_propget..................................................................................................................309 com_propput..................................................................................................................310 com_propset ..................................................................................................................310 com_release ...................................................................................................................310 com_set..........................................................................................................................310 IX. Funzioni per Classi/Oggetti ..............................................................................................311 call_user_method...........................................................................................................314 call_user_method_array ................................................................................................314 class_exists ....................................................................................................................315 get_class ........................................................................................................................315 get_class_methods.........................................................................................................315 get_class_vars................................................................................................................317 get_declared_classes......................................................................................................318 get_object_vars..............................................................................................................318 get_parent_class ............................................................................................................319 is_a.................................................................................................................................319 is_subclass_of................................................................................................................320 method_exists................................................................................................................320 X. Funzioni ClibPDF ..............................................................................................................321 cpdf_add_annotation .....................................................................................................324 cpdf_add_outline ...........................................................................................................324 cpdf_arc .........................................................................................................................324 cpdf_begin_text .............................................................................................................325 cpdf_circle .....................................................................................................................325 cpdf_clip........................................................................................................................325 cpdf_close......................................................................................................................326 cpdf_closepath...............................................................................................................326 cpdf_closepath_ll_stroke.............................................................................................326 cpdf_closepath_stroke ...................................................................................................326 cpdf_continue_text ........................................................................................................326 cpdf_curveto..................................................................................................................327 cpdf_end_text ................................................................................................................327 xi
  12. 12. cpdf_ll..........................................................................................................................327 cpdf_ll_stroke..............................................................................................................328 cpdf_nalize ..................................................................................................................328 cpdf_nalize_page.........................................................................................................328 cpdf_global_set_document_limits.................................................................................328 cpdf_import_jpeg ..........................................................................................................329 cpdf_lineto.....................................................................................................................329 cpdf_moveto ..................................................................................................................329 cpdf_newpath.................................................................................................................330 cpdf_open ......................................................................................................................330 cpdf_output_buffer ........................................................................................................330 cpdf_page_init ...............................................................................................................331 cpdf_place_inline_image...............................................................................................331 cpdf_rect........................................................................................................................331 cpdf_restore ...................................................................................................................331 cpdf_rlineto....................................................................................................................332 cpdf_rmoveto.................................................................................................................332 cpdf_rotate.....................................................................................................................333 cpdf_rotate_text.............................................................................................................333 cpdf_save.......................................................................................................................333 cpdf_save_to_le...........................................................................................................333 cpdf_scale......................................................................................................................333 cpdf_set_action_url .......................................................................................................334 cpdf_set_char_spacing ..................................................................................................334 cpdf_set_creator ............................................................................................................334 cpdf_set_current_page...................................................................................................334 cpdf_set_font .................................................................................................................335 cpdf_set_font_directories ..............................................................................................335 cpdf_set_font_map_le .................................................................................................335 cpdf_set_horiz_scaling..................................................................................................336 cpdf_set_keywords ........................................................................................................336 cpdf_set_leading............................................................................................................336 cpdf_set_page_animation..............................................................................................336 cpdf_set_subject ............................................................................................................336 cpdf_set_text_matrix .....................................................................................................337 cpdf_set_text_pos..........................................................................................................337 cpdf_set_text_rendering ................................................................................................337 cpdf_set_text_rise..........................................................................................................337 cpdf_set_title .................................................................................................................338 cpdf_set_viewer_preferences ........................................................................................338 cpdf_set_word_spacing .................................................................................................338 cpdf_setdash ..................................................................................................................338 cpdf_setat ....................................................................................................................339 cpdf_setgray ..................................................................................................................339 cpdf_setgray_ll............................................................................................................339 cpdf_setgray_stroke.......................................................................................................339 cpdf_setlinecap..............................................................................................................339 cpdf_setlinejoin .............................................................................................................340 cpdf_setlinewidth...........................................................................................................340 cpdf_setmiterlimit..........................................................................................................340 cpdf_setrgbcolor............................................................................................................340 cpdf_setrgbcolor_ll......................................................................................................340 xii
  13. 13. cpdf_setrgbcolor_stroke ................................................................................................341 cpdf_show......................................................................................................................341 cpdf_show_xy................................................................................................................341 cpdf_stringwidth............................................................................................................341 cpdf_stroke ....................................................................................................................342 cpdf_text........................................................................................................................342 cpdf_translate ................................................................................................................342 XI. Funzioni di Crack..............................................................................................................343 crack_check ...................................................................................................................345 crack_closedict ..............................................................................................................345 crack_getlastmessage ....................................................................................................345 crack_opendict...............................................................................................................346 XII. Funzioni CURL, Client URL Library .............................................................................347 curl_close.......................................................................................................................350 curl_errno ......................................................................................................................350 curl_error .......................................................................................................................350 curl_exec........................................................................................................................350 curl_getinfo....................................................................................................................351 curl_init..........................................................................................................................351 curl_setopt .....................................................................................................................351 curl_version ...................................................................................................................355 XIII. Funzioni di pagamento Cybercash.................................................................................356 cybercash_base64_decode.............................................................................................357 cybercash_base64_encode.............................................................................................357 cybercash_decr ..............................................................................................................357 cybercash_encr ..............................................................................................................357 XIV. Crdit Mutuel CyberMUT functions .............................................................................358 cybermut_creerformulairecm ........................................................................................359 cybermut_creerreponsecm.............................................................................................359 cybermut_testmac..........................................................................................................360 XV. Cyrus IMAP administration functions ............................................................................361 cyrus_authenticate .........................................................................................................362 cyrus_bind .....................................................................................................................362 cyrus_close ....................................................................................................................362 cyrus_connect................................................................................................................362 cyrus_query ...................................................................................................................363 cyrus_unbind .................................................................................................................363 XVI. Funzioni di tipo dei caratteri..........................................................................................364 ctype_alnum ..................................................................................................................365 ctype_alpha....................................................................................................................365 ctype_cntrl .....................................................................................................................365 ctype_digit.....................................................................................................................365 ctype_graph ...................................................................................................................365 ctype_lower ...................................................................................................................366 ctype_print.....................................................................................................................366 ctype_punct....................................................................................................................366 ctype_space....................................................................................................................366 ctype_upper ...................................................................................................................367 ctype_xdigit...................................................................................................................367 XVII. Database (dbm-style) abstraction layer functions.........................................................368 dba_close .......................................................................................................................372 dba_delete......................................................................................................................372 xiii
  14. 14. dba_exists ......................................................................................................................372 dba_fetch .......................................................................................................................372 dba_rstkey ...................................................................................................................373 dba_insert ......................................................................................................................373 dba_nextkey...................................................................................................................373 dba_open........................................................................................................................374 dba_optimize .................................................................................................................374 dba_popen......................................................................................................................374 dba_replace....................................................................................................................375 dba_sync........................................................................................................................375 XVIII. Funzioni di Data e Ora ................................................................................................376 checkdate .......................................................................................................................377 date ................................................................................................................................377 getdate............................................................................................................................379 gettimeofday..................................................................................................................380 gmdate ...........................................................................................................................380 gmmktime......................................................................................................................381 gmstrftime......................................................................................................................381 localtime ........................................................................................................................381 microtime.......................................................................................................................382 mktime...........................................................................................................................383 strftime...........................................................................................................................384 strtotime.........................................................................................................................386 time................................................................................................................................387 XIX. Funzioni dBase...............................................................................................................388 dbase_add_record..........................................................................................................389 dbase_close....................................................................................................................389 dbase_create ..................................................................................................................389 dbase_delete_record ......................................................................................................390 dbase_get_record...........................................................................................................390 dbase_get_record_with_names......................................................................................390 dbase_numelds ............................................................................................................391 dbase_numrecords .........................................................................................................391 dbase_open ....................................................................................................................391 dbase_pack ....................................................................................................................392 dbase_replace_record ....................................................................................................392 XX. Funzioni DBM.................................................................................................................393 dblist ..............................................................................................................................394 dbmclose........................................................................................................................394 dbmdelete ......................................................................................................................394 dbmexists.......................................................................................................................394 dbmfetch........................................................................................................................394 dbmrstkey....................................................................................................................394 dbminsert.......................................................................................................................395 dbmnextkey ...................................................................................................................395 dbmopen ........................................................................................................................395 dbmreplace ....................................................................................................................396 XXI. dbx functions..................................................................................................................397 dbx_close.......................................................................................................................400 dbx_compare .................................................................................................................400 dbx_connect...................................................................................................................401 dbx_error .......................................................................................................................402 xiv
  15. 15. dbx_query......................................................................................................................403 dbx_sort.........................................................................................................................406 XXII. DB++ Functions ...........................................................................................................407 dbplus_add.....................................................................................................................411 dbplus_aql......................................................................................................................411 dbplus_chdir ..................................................................................................................411 dbplus_close ..................................................................................................................412 dbplus_curr....................................................................................................................412 dbplus_errcode ..............................................................................................................412 dbplus_errno..................................................................................................................413 dbplus_nd ....................................................................................................................413 dbplus_rst ....................................................................................................................414 dbplus_ush...................................................................................................................414 dbplus_freealllocks........................................................................................................414 dbplus_freelock .............................................................................................................415 dbplus_freerlocks ..........................................................................................................415 dbplus_getlock...............................................................................................................416 dbplus_getunique...........................................................................................................416 dbplus_info....................................................................................................................416 dbplus_last.....................................................................................................................417 dbplus_lockrel ...............................................................................................................417 dbplus_next....................................................................................................................417 dbplus_open...................................................................................................................418 dbplus_prev ...................................................................................................................418 dbplus_rchperm .............................................................................................................419 dbplus_rcreate................................................................................................................419 dbplus_rcrtexact.............................................................................................................420 dbplus_rcrtlike...............................................................................................................420 dbplus_resolve...............................................................................................................420 dbplus_restorepos..........................................................................................................421 dbplus_rkeys..................................................................................................................421 dbplus_ropen .................................................................................................................421 dbplus_rquery................................................................................................................422 dbplus_rrename .............................................................................................................422 dbplus_rsecindex ...........................................................................................................422 dbplus_runlink...............................................................................................................423 dbplus_rzap....................................................................................................................423 dbplus_savepos..............................................................................................................423 dbplus_setindex .............................................................................................................424 dbplus_setindexbynumber.............................................................................................424 dbplus_sql......................................................................................................................424 dbplus_tcl ......................................................................................................................425 dbplus_tremove .............................................................................................................425 dbplus_undo ..................................................................................................................426 dbplus_undoprepare ......................................................................................................426 dbplus_unlockrel ...........................................................................................................426 dbplus_unselect .............................................................................................................427 dbplus_update................................................................................................................427 dbplus_xlockrel .............................................................................................................427 dbplus_xunlockrel .........................................................................................................428 XXIII. Direct IO functions......................................................................................................429 dio_close........................................................................................................................430 xv
  16. 16. dio_fcntl.........................................................................................................................430 dio_open ........................................................................................................................430 dio_read .........................................................................................................................431 dio_seek.........................................................................................................................431 dio_stat ..........................................................................................................................431 dio_truncate ...................................................................................................................432 dio_write........................................................................................................................432 XXIV. Funzioni per le directory.............................................................................................433 chdir...............................................................................................................................434 chroot.............................................................................................................................434 dir...................................................................................................................................434 closedir ..........................................................................................................................435 getcwd............................................................................................................................435 opendir...........................................................................................................................435 readdir............................................................................................................................436 rewinddir........................................................................................................................437 XXV. DOM XML functions...................................................................................................438 DomAttribute->name ....................................................................................................446 DomAttribute->specied...............................................................................................446 DomAttribute->value.....................................................................................................446 DomDocument->add_root [deprecated]........................................................................446 DomDocument->create_attribute..................................................................................447 DomDocument->create_cdata_section..........................................................................447 DomDocument->create_comment ................................................................................447 DomDocument->create_element...................................................................................448 DomDocument->create_entity_reference .....................................................................448 DomDocument->create_processing_instruction...........................................................448 DomDocument->create_text_node................................................................................449 DomDocument->doctype ..............................................................................................449 DomDocument->document_element ............................................................................449 DomDocument->dump_le...........................................................................................450 DomDocument->dump_mem........................................................................................451 DomDocument->get_element_by_id ............................................................................451 DomDocument->get_elements_by_tagname ................................................................452 DomDocument->html_dump_mem ..............................................................................452 DomDocumentType->entities .......................................................................................452 DomDocumentType->internal_subset...........................................................................453 DomDocumentType->name ..........................................................................................453 DomDocumentType->notations ....................................................................................453 DomDocumentType->public_id....................................................................................454 DomDocumentType->system_id...................................................................................454 DomElement->get_attribute..........................................................................................455 DomElement->get_attribute_node ................................................................................455 DomElement->get_elements_by_tagname....................................................................455 DomElement->has_attribute..........................................................................................455 DomElement->remove_attribute...................................................................................456 DomElement->set_attribute ..........................................................................................456 DomElement->set_attribute_node.................................................................................457 DomElement->tagname.................................................................................................457 DomNode->append_child .............................................................................................457 DomNode->append_sibling ..........................................................................................459 DomNode->attributes....................................................................................................459 xvi
  17. 17. DomNode->child-nodes ................................................................................................459 DomNode->clone_node ................................................................................................459 DomNode->dump_node................................................................................................460 DomNode->rst_child...................................................................................................460 DomNode->get_content ................................................................................................460 DomNode->has_attributess ...........................................................................................461 DomNode->has_child_nodes ........................................................................................461 DomNode->insert_before..............................................................................................461 DomNode->is_blank_node............................................................................................462 DomNode->last_child ...................................................................................................462 DomNode->next_sibling ...............................................................................................462 DomNode->node_name ................................................................................................463 DomNode->node_type ..................................................................................................464 DomNode->node_value.................................................................................................464 DomNode->owner_document .......................................................................................464 DomNode->parent_node...............................................................................................465 DomNode->prex..........................................................................................................466 DomNode->previous_sibling ........................................................................................466 DomNode->remove_child.................