Visualizzazione dei risultati da 1 a 5 su 5

Discussione: String in un Object

  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2004
    Messaggi
    16

    String in un Object

    ho un object con all'interno un campo string, come faccio ad accedervi??

  2. #2
    eh ?
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  3. #3
    Utente di HTML.it
    Registrato dal
    Nov 2004
    Messaggi
    16

    mi spiego

    ho una funzione che mi restituisce un object così:
    object -

    array $return->headers - an associative array of the headers. The keys of the array are the header names (lowercased) whilst the values are the header values (original case). If there are multiple headers with the same name (eg. Received: ) then the value is a numerically indexed array of each of the header values. If the parameter decode_headers is specified as TRUE, the headers will be decoded according to RFC 2047.

    string $return->ctype_primary - the first part of the content type (ie. before the forward slash). Eg. if the content type is multipart/mixed, ctype_primary would be "multipart".

    string $return->ctype_secondary - the second part of the content type. Eg. If the content type is multipart/mixed, ctype_secondary would be "mixed".

    array $return->ctype_parameter - if the content type header has any parameters (eg. boundary="=_hudfhdsalfhds8fy8329hfj") then they will be in this associative array. Keys are the parameter name (eg. boundary) whilst the values are the parameter values (eg. =_hudfhdsalfhds8fy8329hfj).

    string $return->disposition - if the Content-Disposition header is present, its value will be given here. This is usually either "inline" or "attachment".

    array $return->d_parameters - if any parameters are given with the Content-Disposition header, they will be given here in an associative array, keys being the parameter names and values being the parameter values. "name" and "filename" are two common examples here.

    array $return->body - if the include_bodies parameter is given when instanciating the class, (either statically or via a concrete instance), then this will be present if the part in question has a body. MIME parts with content type multipart/* generally do not not have bodies, instead consisting of subparts. If the parameter decode_bodies is specified as TRUE then the body will be decoded.

    array $return->parts - if a MIME part consists of subparts, then this array will be present consisting of objects with the same properties as described here.

    come faccio ad accedere a body

  4. #4
    for( $a = 0, $b = &count( $return->body ); $a < $b; ) {
    echo $return->body[$a++]."\r\n";
    }
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  5. #5
    Utente di HTML.it
    Registrato dal
    Nov 2004
    Messaggi
    16
    purtroppo non funziona...
    ma non c'è un modo per accedrci direttamente?
    con gli array basta fare $return->headers(per esempio), ma con le stringhe non funziona

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.