PHP If URL contains only a certain parameter -
i understand can use following see if parameter p exists in url. work if there q, t, r etc parameter
if(isset($_get['p'])) {}
i know following sees if there parameter set
if(count($_get)) {}
however need is:
if parameter p exists -> something... else if parameter p exists , other parameter exists else something... else if parameter != p , or no parameter exists - else
any tips appreciated
if(isset($_get['p']) && count($_get['p']) == 1){ //do } else if (isset($_get['p'])){ //do } else { //do else }
Comments
Post a Comment