PHP code example of veloxia / php-helpers

1. Go to this page and download the library: Download veloxia/php-helpers 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/ */

    

veloxia / php-helpers example snippets

bash
composer 
 php
$text = 'This costs $200,00 including shipping.';

$exp = '\$(200),00'; // instead of /\$(200),00/i

echo capture($exp, $text);  // returns 200
 php
$text = 'This costs 200 EUR including shipping.';
$exps = [
  '(\d+) USD',
  '(\d+) GBP',
  '\$(\d+)',
  '(\d+)',
];
echo capture_list($exps, $text); // => 200
 php
echo number_range(10.5, 13.9, 2, '%');
// 10,50 – 13,90 %