The following function checks if two multidimensional arrays have the same structure.
Unit testing
The post will sotre some useful stuff related to PHP unit testing.
Documnetation:
more...
Documnetation:
PHP debug tricks
Sometimes when you work on a messy code with a lot of dependencies and don't have a nice debug tool you may have to dump some output to get the data that you need. Here are some examples:
Get the script that was called:
more...
Get the script that was called:
Convert array to CSV
The following functions will allow you to easily convert arrays to CSV formatted strings or CSV files.
One of the methods converts a CSV file to array that could be associative with the right function parameters.
more...
One of the methods converts a CSV file to array that could be associative with the right function parameters.
Shred by key
Simple method that could be used to split some content by string keys.
Could be used to distribute content in shredded tables or processing on different nodes.
more...
Could be used to distribute content in shredded tables or processing on different nodes.
Get multidimensional array values using string key
This function allows to extract values of multidimensional using string as key chain.
more...
Simple UDP server and client
Here is a basic UDP socket server that echoes the IP and port of the remote requests.
In addition there's a client that could be used for testing.
more...
In addition there's a client that could be used for testing.
PHP & cURL class
This is a simple PHP class with a few useful cURL functions. It could be used for automatic forms submission, crawling web pages that require a login and some other purposes...
Version 2.0 of the class is available at the bottom of the page.
more...
Version 2.0 of the class is available at the bottom of the page.
Debug PHP HTTP GET requests
This method was created in order to help a client to debug the issues with sending an HTTP GET request via PHP.
more...
Validate Bulgarian ID number (EGN)
This function will allow you to verify if a given string matches the standard
for unique ID of Bulgarian citizen (EGN).
more...
for unique ID of Bulgarian citizen (EGN).
Send payments via ePay.bg
The following class will enable you to send payments via ePay.bg.
It also provides ability to decode and verify the payment notifications.
more...
It also provides ability to decode and verify the payment notifications.
PHP SFTP library
A great PHP SFTP library.
At this point there's no need for additional explanations.
more...
At this point there's no need for additional explanations.
TOR requests via PHP
This post describes the way of sending TOR requests using PHP.
The source of the code and the concept is https://gist.github.com/sxss/acfdce73976f219a6695
The script requires to install TOR:
more...
The source of the code and the concept is https://gist.github.com/sxss/acfdce73976f219a6695
The script requires to install TOR:
Translation class
This class allows to set simple translation for any project.
It uses files with JSON encoded array for each language.
- The new keywords are automatically added to the language file.
more...
It uses files with JSON encoded array for each language.
- The new keywords are automatically added to the language file.
Encryption using openssl
The following script is useful to encrypt small strings using public key and
enables the data decryption via the private key.
The string size (2048/8-11 bites) or around 245 symbols depending on the encoding.
more...
enables the data decryption via the private key.
The string size (2048/8-11 bites) or around 245 symbols depending on the encoding.
PHP email validation class
This here is the best email validation class that I've ever seen. It checks for every official requirement I know about. Unfortunetly the class can`t validate corectly email addresses from cyrillic and other non ASCII domains if they are presented in unicode but it works fine if the emails are converted to IDNA ASCII form. For example:
The validation of example@россия.рф would not work properly but example@xn--h1alffa9f.xn--p1ai is just fine.
more...
The validation of example@россия.рф would not work properly but example@xn--h1alffa9f.xn--p1ai is just fine.
Authentication
The post will contain different authentication methods.
Some day in the future they may be added to class.
more...
Some day in the future they may be added to class.
SOAP requests class
A simple PHP class that gives the means to send SOAP requests via
cURL or PHP SoapClient.
more...
cURL or PHP SoapClient.
PHP image edit class
This class implements image editing options like multiple resize options, crops, watermarks, blurs, color changes, generation of gradients and so on.
The class uses GD library.
more...
The class uses GD library.
PHP date and time class
This class contains some useful functions to help me deal with some common date and time calculations.
more...
PHP string class
The class will contain functions for multiple operations related to strings.
more...
SPF record check
If you are runing a blast email service or for any other reason need to send emails from servers that are not hosting the domain name that you will set as sender in the email message you need to set SPF record on the web page server to make sure that the messages will not end in the SPAM. You can do manual checks but if you have multiple clients or you want to have an insurance that some client will not disable the SPF record right before the next blast message - here comes this useful function:
more...
Upload class
This class makes uploading files quick and easy.
It supports multiple file uploads and wide variety of settings related to files location, size, type, names and so on.
more...
It supports multiple file uploads and wide variety of settings related to files location, size, type, names and so on.
PHP price calculator
This is the first version of a class that will contain methods to be used to calculate taxes, prices, percentage, interest fees and so on.
more...
Random codes generation
This function generates large number of unique codes.
It's useful for product package codes for promotional.
It's good idea to skip symbols that may be visually similar (like 1 and I).
more...
It's useful for product package codes for promotional.
It's good idea to skip symbols that may be visually similar (like 1 and I).
PHP MySQL class
This class is used to establish MySQL connection and to extract data in easy to use formats as arrays or objects. The main goal is to make the database operations quick and easy.
more...
PHP excel class
The main idea of the class is to provide an easy way to read and create excel files from arrays of data.
NOTE: This class requires PHP Excel Library
NOTE: The library requires:
more...
NOTE: This class requires PHP Excel Library
NOTE: The library requires:
PHP captcha class
This class will allow you to generate custom captcha images fast and easy. Keep in mind that if you use AJAX to submit your forms you need to generate a new captcha image after each submit.
Here's a wide list of font files Font Squirrel
more...
Here's a wide list of font files Font Squirrel