Download the PHP package malenki/coord2coord without Composer
On this page you can find all versions of the php package malenki/coord2coord. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download malenki/coord2coord
More information about malenki/coord2coord
Files in malenki/coord2coord
Package coord2coord
Short Description Convert spreadsheet coordinate to numeric coordinates and vice versa
License MIT
Homepage https://github.com/malenkiki/coord2coord
Informations about the package coord2coord
coord2coord
Convert spreadsheet columns coordinates to numeric coordinates and reverse too
Why?
Sometimes, when you develop some code about some CSV or something like that, you have reference given by some people using spreadsheet value (column A, AA, Z…) or index value (1, 2, 3) or even index value starting to zero (0, 1, 2…).
So, this little library deals with that. So, you can easily switch from one system to another.
How?
You can play with it using two ways:
- By using library to use it into your code
- By using CLI script available.
Using the library
Very simple, install it using composer. You can find it on https://packagist.org/packages/malenki/coord2coord.
Quick example converting spreadsheet column name to index starting from one:
Now the same with index starting from zero (note the constructor's call):
Example to show how to convert index to spreadsheet column name:
Again, we can also use starting point as zero:
You can also magically convert integer to letters or the reverse:
That's all to know!
But you must also know that if you use incorrect value for index (negative integer, non integer, or zero when starting point is one) then this raises an exception (InvalidArgumentException
is it is not an integer or OutOfRangeException
for other cases).
Also, if you use any other value than ASCII characters a-zA-Z
for convert spreadsheet column name to index then an InvalidArgumentException
occurs.
Using CLI script
Again, install it using composer, then, composer install
into root directory of sources.
A script is available into bin\coord2coord
.
Other way is to use PHAR file, so, just download it or create it using box by doing box build
into the root of sources.
Play with it is very simple:
Simple, isn't it?