Re: File extension for PHP's serialization format?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hamish Lawson wrote:
I have a web application (not written in PHP) that can return data in various formats, including JSON and PHP's serialization format. At the moment my URL scheme looks like this:

    staff/engineering?format=json

but I'd like to switch to using a file extension to denote the format:

    staff/engineering.json

But what file extension should I use for PHP's serialization format? Obviously it can't be .php - aside from being inaccurate (it's not PHP code), using this extension would probably trigger the web server into trying to run a (nonexistent) PHP script.

Given that file extensions are purely for association purposes and no application I am aware of knows what to do with PHP serialised data, personally I would use .dat. Or, if I wanted it to be more descriptive, something like .phpdata. But to be perfectly frank it doesn't matter.

Small suggestion though... rather than falling back to the evils of mod_rewrite, enable multiviews and you can have URLs such as...

staff/engineering/data.json

Or whatever filename you want.

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux