PluginProbe
Yatra – Travel Booking & Tour Operator Software / 2.1.16
Yatra – Travel Booking & Tour Operator Software v2.1.16
3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 2.0.11 All 82 releases
yatra / core / Helper.php

Helper.php in Yatra – Travel Booking & Tour Operator Software 2.1.16, at core/Helper.php

46 lines 1008 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yatra\Core;
4
5 defined('ABSPATH') || exit;
6
7 class Helper
8 {
9 public function input($input = '', $old_data = null)
10 {
11 if (!$old_data) {
12 $old_data = $_POST;
13 }
14 $value = $this->avalue_dot($input, $old_data);
15 if ($value) {
16 return $value;
17 }
18 return '';
19 }
20
21 public function array_get($key = null, $array = array(), $default = false)
22 {
23 return $this->avalue_dot($key, $array, $default);
24 }
25
26 public function avalue_dot($key = null, $array = array(), $default = false)
27 {
28 $array = (array)$array;
29 if (!$key || !count($array)) {
30 return $default;
31 }
32 $option_key_array = explode('.', $key);
33
34 $value = $array;
35
36 foreach ($option_key_array as $dotKey) {
37 if (isset($value[$dotKey])) {
38 $value = $value[$dotKey];
39 } else {
40 return $default;
41 }
42 }
43 return $value;
44 }
45 }
46