# yatra/2.2.10/core/Helper.php

Yatra – Travel Booking &amp; Tour Operator Software, version 2.2.10. 46 lines.

- Page: https://pluginprobe.com/plugins/yatra/2.2.10/code/core/Helper.php
- Raw: https://pluginprobe.com/plugins/yatra/2.2.10/raw/core/Helper.php
- Modified: 2022-11-10T16:58:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/yatra/2.2.10/code/core/Helper.php#L10-L20`.

```php
<?php

namespace Yatra\Core;

defined('ABSPATH') || exit;

class Helper
{
    public function input($input = '', $old_data = null)
    {
        if (!$old_data) {
            $old_data = $_POST;
        }
        $value = $this->avalue_dot($input, $old_data);
        if ($value) {
            return $value;
        }
        return '';
    }

    public function array_get($key = null, $array = array(), $default = false)
    {
        return $this->avalue_dot($key, $array, $default);
    }

    public function avalue_dot($key = null, $array = array(), $default = false)
    {
        $array = (array)$array;
        if (!$key || !count($array)) {
            return $default;
        }
        $option_key_array = explode('.', $key);

        $value = $array;

        foreach ($option_key_array as $dotKey) {
            if (isset($value[$dotKey])) {
                $value = $value[$dotKey];
            } else {
                return $default;
            }
        }
        return $value;
    }
}

```
