1. Go to this page and download the library: Download swouters/postgresql-tools library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
swouters / postgresql-tools example snippets
// Array example
$array = [
'age' => 30,
'name' => ['John', 'Doe'],
];
// Signature
public function build(
array $array, // The array of conditions
string $firstLevelOperator = 'AND', // The operator used between 1st level values (age=30 and ...)
string $secondLevelOperator = 'OR', // The operator used if a value is an array (name=John OR name=Doe)
array $comparisonOperators = [], // Default is '='. You can set a specific operator for a key
array $replaces = [] // Replace the key used for the SQL column
): array