Is it possible to store permanent variables in PHP, i.e. final unmodifiable variables, but which can be read by all users requesting a page?
E.g. I would need to use a dictionary on a page, starting with a big (invariant) word list. What is the best way to do this?
file_exists()
is fast enough but uses 4KB per word, which is a total waste of disk space.What would be the proper way to store this dictionary?
memcached is very popular in php as a way to keep stuff in memory that can be accessed by many processes http://php.net/manual/en/book.memcached.php
a similar solution could be to use an sqlite shared memory database http://www.sqlite.org/inmemorydb.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With