2017 © Pedro Peláez
 

library ana

Ana is my personal library of PHP 7 compatible helper functions

image

imonroe/ana

Ana is my personal library of PHP 7 compatible helper functions

  • Sunday, June 17, 2018
  • by imonroe
  • Repository
  • 1 Watchers
  • 0 Stars
  • 109 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

ana

Latest Version on Packagist ![Software License][ico-license] Total Downloads, (*1)

Install

Via Composer, (*2)

``` bash $ composer require imonroe/ana, (*3)


## Usage ``` php use imonroe\ana\Ana; $formatted_date = Ana::standard_date_format(strtotime('yesterday')); if (Ana::even_or_odd(2) == 'even'){ // do something } if (Ana::is_valid_link('https://www.google.com')){ // link is valid and curl-able } // grab a file from the web and save it to a text file. Ana::create_file('sample.txt', Ana::quick_curl('https://www.sample.com/index.html'), true);

Available Methods:

All methods are static., (*4)

  • standard_date_format($timestamp = '')
  • sql_datetime($timestamp = '')
  • google_datetime($timestamp = '')
  • is_today($date_string)
  • sooner_than($date_string)
  • later_than($date_string)
  • print_relative_date($date)
  • fatal_handler()
  • dd($var)
  • array_unique_multi($arr)
  • array_sort_by_column(&$arr, $col, $dir = SORT_ASC)
  • object_to_array($object)
  • build_tree($flat, $pidKey, $idKey = null)
  • csv_to_array($filename='', $delimiter=',')
  • plural($quantity)
  • word_limit($haystack, $ubound)
  • convert_to_utf($input)
  • plain_text($input)
  • trim_string_to_length($str, $len)
  • use_a_or_an($text)
  • even_or_odd($number)
  • random_number($lowbound = 1, $highbound = 100)
  • random_hex($bytes = 8)
  • generateStrongPassword($length = 9, $add_dashes = false, $available_sets = 'luds')
  • create_nonce()
  • current_page_url()
  • get_url_segment($number)
  • is_valid_link($link)
  • quick_curl($link)
  • get_ip()
  • submit_post_request($url, $data)
  • loading_spinner()
  • code_safe_name($string)
  • cast($destination, $sourceObject)
  • ask_user($prompt)
  • say($msg)
  • error_out($msg)
  • create_directory($directory_path, $perms = 0777)
  • remove_directory($path)
  • create_file($file_path_and_name, $file_content, $overwrite = false)
  • append_file($file_path_and_name, $file_content, $overwrite = false)
  • get_url_and_save($fully_qualified_url, $filename)
  • read_file_to_string($filename)
  • get_directory_list($directory_path)
  • execute($cmd)
  • get_arguments()
  • replace_line_in_file(String $filename='', String $line_to_change='', String $change_to='')
  • replace_and_save($oldFile, $search, $replace, $newFile = null)
  • us_states()

Change log

Please see CHANGELOG for more information on what has changed recently., (*5)

Testing

bash $ composer test, (*6)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*7)

Security

If you discover any security related issues, please email ian@ianmonroe.com instead of using the issue tracker., (*8)

Credits

License

The MIT License (MIT). Please see License File for more information., (*9)

The Versions

17/06 2018

dev-master

9999999-dev https://github.com/imonroe/ana

Ana is my personal library of PHP 7 compatible helper functions

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

imonroe ana

17/06 2018

1.0.5

1.0.5.0 https://github.com/imonroe/ana

Ana is my personal library of PHP 7 compatible helper functions

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

imonroe ana

16/03 2018

1.0.4

1.0.4.0 https://github.com/imonroe/ana

Ana is my personal library of PHP 7 compatible helper functions

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

imonroe ana

25/01 2018

1.0.3

1.0.3.0 https://github.com/imonroe/ana

Ana is my personal library of PHP 7 compatible helper functions

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

imonroe ana

24/08 2017

1.0.2

1.0.2.0 https://github.com/imonroe/ana

Ana is my personal library of PHP 7 compatible helper functions

  Sources   Download

MIT

The Requires

 

The Development Requires

imonroe ana

17/08 2017

1.0.1

1.0.1.0 https://github.com/imonroe/ana

Ana is my personal library of PHP 7 compatible helper functions

  Sources   Download

MIT

The Requires

 

The Development Requires

imonroe ana