How can I check if an URL has parameters in it?
for instance, if the string is like this,
form_page_add.php?parent_id=1
return true
But if it is like this,
form_page_add.php?
return nothing
Thanks.
EDIT:
Sorry for not being clear, the URL is submitted from a from as a string. and I will store that string in a variable,
if(isset($_POST['cfg_path'])) $cfg_path = trim($_POST['cfg_path']);
so I need to check this variable $cfg_path whether
is has parameters in it.
Could also look for a specific key with array_key_exists(), e.g.
if(array_key_exists('some-key', $_GET))
http://php.net/manual/en/function.array-key-exists.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With