|
1 |
| -# TopPHPFunctions |
| 1 | +# Top PHP Functions |
| 2 | + |
| 3 | +## The 100 PHP functions that you have to know (2022) |
| 4 | + |
| 5 | +Here is the top 100 PHP functions: it is the list of the most often used PHP native functions. |
| 6 | + |
| 7 | +### PHP Functions |
| 8 | + |
| 9 | +| Rank | Function | Frequency | Average | |
| 10 | +| ------ | --------- | ------------- | ------- | |
| 11 | +| 1 | file-exists | 62.80% | 13 | |
| 12 | +| 2 | str-replace | 58.20% | 33 | |
| 13 | +| 3 | implode | 57.31% | 35 | |
| 14 | +| 4 | count | 56.42% | 61 | |
| 15 | +| 5 | dirname | 56.38% | 13 | |
| 16 | +| 6 | substr | 55.84% | 53 | |
| 17 | +| 7 | sprintf | 55.26% | 80 | |
| 18 | +| 8 | strpos | 55.07% | 24 | |
| 19 | +| 9 | array_merge | 54.80% | 35 | |
| 20 | +| 10 | in_array | 51.39% | 33 | |
| 21 | +| 11 | explode | 51.35% | 26 | |
| 22 | +| 12 | strlen | 50.97% | 35 | |
| 23 | +| 13 | is_array | 50.73% | 46 | |
| 24 | +| 14 | array_key_exists | 49.54% | 28 | |
| 25 | +| 15 | array_keys | 49.27% | 16 | |
| 26 | +| 16 | preg_match | 46.52% | 28 | |
| 27 | +| 17 | file_get_contents | 46.48% | 8 | |
| 28 | +| 18 | is_file | 44.43% | 6 | |
| 29 | +| 19 | array_values | 42.81% | 7 | |
| 30 | +| 20 | file_put_contents | 42.46% | 4 | |
| 31 | +| 21 | trim | 41.57% | 25 | |
| 32 | +| 22 | method_exists | 41.49% | 8 | |
| 33 | +| 23 | defined | 40.87% | 19 | |
| 34 | +| 24 | is_string | 40.76% | 20 | |
| 35 | +| 25 | function_exists | 40.29% | 20 | |
| 36 | +| 26 | array_map | 39.33% | 12 | |
| 37 | +| 27 | preg_replace | 39.02% | 17 | |
| 38 | +| 28 | strtolower | 38.94% | 19 | |
| 39 | +| 29 | is_dir | 38.67% | 6 | |
| 40 | +| 30 | strtr | 38.01% | 5 | |
| 41 | +| 31 | call_user_func | 37.01% | 4 | |
| 42 | +| 32 | strrpos | 36.70% | 4 | |
| 43 | +| 33 | call_user_func_array | 36.43% | 3 | |
| 44 | +| 34 | array_flip | 35.89% | 2 | |
| 45 | +| 35 | fwrite | 35.89% | 4 | |
| 46 | +| 36 | rtrim | 35.69% | 6 | |
| 47 | +| 37 | filter_var | 35.65% | 2 | |
| 48 | +| 38 | ini_get | 35.15% | 5 | |
| 49 | +| 39 | json_decode | 34.76% | 7 | |
| 50 | +| 40 | array_filter | 34.76% | 7 | |
| 51 | +| 41 | realpath | 34.15% | 4 | |
| 52 | +| 42 | header | 34.07% | 7 | |
| 53 | +| 43 | class_exists | 34.03% | 12 | |
| 54 | +| 44 | json_encode | 33.49% | 9 | |
| 55 | +| 45 | trigger_error | 32.95% | 5 | |
| 56 | +| 46 | get_class | 32.95% | 13 | |
| 57 | +| 47 | spl_autoload_register | 32.10% | 1 | |
| 58 | +| 48 | unlink | 30.43% | 5 | |
| 59 | +| 49 | headers_sent | 29.78% | 1 | |
| 60 | +| 50 | is_object | 29.31% | 11 | |
| 61 | +| 51 | mkdir | 29.20% | 2 | |
| 62 | +| 52 | array_shift | 28.69% | 6 | |
| 63 | +| 53 | spl_autoload_unregister | 28.54% | 1 | |
| 64 | +| 54 | apcu_fetch | 28.23% | 0 | |
| 65 | +| 55 | array_pop | 28.11% | 5 | |
| 66 | +| 56 | stream_resolve_include_path | 27.84% | 0 | |
| 67 | +| 57 | is_int | 27.65% | 5 | |
| 68 | +| 58 | apcu_add | 27.57% | 0 | |
| 69 | +| 59 | getcwd | 27.49% | 1 | |
| 70 | +| 60 | strtoupper | 27.42% | 6 | |
| 71 | +| 61 | is_numeric | 26.95% | 9 | |
| 72 | +| 62 | array_unique | 26.91% | 4 | |
| 73 | +| 63 | ltrim | 26.60% | 4 | |
| 74 | +| 64 | basename | 26.57% | 4 | |
| 75 | +| 65 | str_repeat | 26.26% | 7 | |
| 76 | +| 66 | fopen | 25.91% | 6 | |
| 77 | +| 67 | array_slice | 24.94% | 3 | |
| 78 | +| 68 | getenv | 24.94% | 4 | |
| 79 | +| 69 | var_export | 24.71% | 3 | |
| 80 | +| 70 | preg_match_all | 24.67% | 3 | |
| 81 | +| 71 | is_callable | 24.48% | 4 | |
| 82 | +| 72 | reset | 24.44% | 4 | |
| 83 | +| 73 | preg_split | 24.40% | 3 | |
| 84 | +| 74 | fclose | 24.36% | 5 | |
| 85 | +| 75 | array_unshift | 24.25% | 3 | |
| 86 | +| 76 | gettype | 24.21% | 4 | |
| 87 | +| 77 | end | 23.90% | 3 | |
| 88 | +| 78 | array_search | 23.82% | 3 | |
| 89 | +| 79 | max | 23.78% | 5 | |
| 90 | +| 80 | extension-loaded | 23.59% | 3 | |
| 91 | +| 81 | is_bool | 23.55% | 2 | |
| 92 | +| 82 | version_compare | 22.82% | 3 | |
| 93 | +| 83 | preg_quote | 22.78% | 3 | |
| 94 | +| 84 | time | 22.70% | 9 | |
| 95 | +| 85 | ucfirst | 22.66% | 4 | |
| 96 | +| 86 | ksort | 22.66% | 2 | |
| 97 | +| 87 | preg_replace_callback | 22.54% | 3 | |
| 98 | +| 88 | md5 | 22.51% | 4 | |
| 99 | +| 89 | array_reverse | 22.47% | 2 | |
| 100 | +| 90 | array_diff | 22.12% | 2 | |
| 101 | +| 91 | is_readable | 22.00% | 1 | |
| 102 | +| 92 | microtime | 21.96% | 4 | |
| 103 | +| 93 | copy | 21.81% | 1 | |
| 104 | +| 94 | parse_url | 21.81% | 2 | |
| 105 | +| 95 | is_null | 21.50% | 17 | |
| 106 | +| 96 | base64_encode | 21.42% | 3 | |
| 107 | +| 97 | current | 21.38% | 2 | |
| 108 | +| 98 | is_resource | 21.08% | 3 | |
| 109 | +| 99 | serialize | 20.77% | 4 | |
| 110 | +| 100 | key | 20.57% | 2 | |
| 111 | + |
| 112 | +Source: https://www.exakat.io/en/the-100-php-functions/ |
0 commit comments