Read .properties files using PHP [duplicate] - php

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Does PHP allow *.properties file as in Java?
How to read/parse .properties file using PHP?

.properties files are usually used in Java platform. Its counterpart in PHP is .ini files. .ini files can be parsed natively by PHP using parse_ini_file(). See this stackoverflow question: Does PHP allow *.properties file as in Java?.
Still, if you would like to read and parse .properties files, you have to do that manually. A quick search on Google take me to the following result:
reading java-style properties file in PHP - Github repository
Hope this helps :)

Related

PHP a path beginning with / uses the root of the linux box it's hosted on. How to make / refer to the site root [duplicate]

This question already has answers here:
PHP get website root absolute URL in server?
(4 answers)
Closed 8 years ago.
This would make including files a lot easier. Is there anyway of doing this, for instance in a .htaccess file?
PHP will reference files from where the file is located are like you have stated, and PHP is typically not aware of the URL that it is working with. I would recommend using spl_autoloader (http://php.net/manual/en/function.spl-autoload.php) so that you only have to include one file and then spl_autoloader will include the rest of your classes.
Also look at:https://github.com/theseer/Autoload

How do you open an MS Word file with php? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Create Word Document using PHP in Linux
I am trying to open Word files and edit them on linux based operating system.
is there any PHP API that enables me to open and edit word file?
I want to read and edit these files and view the images and the text formating.
We used COM objects to open up MATLAB using PHP on a Windows machine. We were able to control it pretty decently, pass scripts and such. You might want to take a look at that.

Does PHP have a tar like function? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Build Tar file from directory in PHP without exec/passthru
Does PHP have a tar like function? So that I can create a tar file containing some dirs just created?
Archive_Tar will do this for you. You should know that this only makes a file that contains a lot of files; they aren't compressed at all. Consider compressing with gzip for text data or bzip for binary data.

Why can't I compile PHP code? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Can you “compile” PHP code?
After I write an application in PHP, why can't I compile it into machine language? I know that it's possible to make a byte-code version of the file, which (as I understand it) is basically a file that has already been parsed into tokens.
But that's not what I want. Clearly it can't work in a general sense, since compiled code will be platform-specific, but let's say I have chosen a given platform. Why can't I create a binary file that would be the same code that PHP would run when given my .php file?
You can, facebook released a project which is currently being updated for php 5.3 (supports everything lower iirc) called HipHop, you can find it here: https://github.com/facebook/hiphop-php
There are a few compilers out there like facebook's, mentioned by #Howard, or http://www.roadsend.com/home/index.php?pageID=compiler. I've never tried them though.

How can I modify exif data of an image with PHP [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How do I add exif data to an image?
I want to modify some information in exif data with PHP. I've googled around but no hope. There's function in PHP, exif_read_data. But it only reads not writes. Anybody knows how or walkaround?
Looks fairly old but may be something for you: http://pel.sourceforge.net/
This gets also mentioned in the linked article from Calvin L.
http://pel.sourceforge.net/
A php extension that can write exif data, with installation instructions using PEAR. It requires that you can control which extensions are being installed on the machine that runs your PHP, which is not the case in many virtual hosting environments.

Categories