Web Analytics Made Easy -
StatCounter pathinfo question? - CodingForum

Announcement

Collapse
No announcement yet.

pathinfo question?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • pathinfo question?

    Hello,

    I'm using pathinfo to get the extension of an uploaded file:


    PHP Code:
    $path_parts pathinfo($_FILES['ufile']['name'][0])
    $extension $path_parts['extension']; 
    and it all works fine, but now what I want to do is add a dot to the filename when I remame it:

    PHP Code:
    $picunique time()".""".$extension.""
    How can I do this, am I being very silly?
    Thanks
    Last edited by stfc_boy; Apr 10, 2009, 07:47 AM.

  • #2
    But the $path_parts variable I get back is just declared as an array?
    That is what pathinfo() returns.
    Originally posted by http://php.net/pathinfo
    Return Values

    The following associative array elements are returned: dirname, basename, extension (if any), and filename.

    If options is used, this function will return a string if not all elements are requested.
    Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

    Comment


    • #3
      Apologies, abduraooft I did not explain myself very well before, and have edited above.

      Comment


      • #4
        PHP Code:
        $picunique time().".".$extension
        Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

        Comment

        Working...
        X