Hello @kartik,
The best way for getting input string is:
$value = filter_input(INPUT_POST, 'value');
This one-liner is almost equivalent to:
if (!isset($_POST['value'])) {
$value = null;
} elseif (is_array($_POST['value'])) {
$value = false;
} else {
$value = $_POST['value'];
}
If you absolutely want string value, just like:
$value = (string)filter_input(INPUT_POST, 'value');
Hope this is helpful!!
Thank You!!