I want to change the a / a article on a web page based on a parameter passed through a URL. So, for example, I have mywebpage.com/?page&qry=dog as a URL, so I would like any a / a articles to be a "dog" (against aardvark it was qry). I'm trying to use the code below, however, I get a parsing error anytime when I try to load the page.
<?php in_array(substr($_GET['qry'],0,1), array('a','e','i','o','u')) ? 'an' 'a'; ?>
If I also tried the IF / ELSE statement, which led to the same result.
<?php if(in_array(substr($_GET['qry'],0,1), array('a','e','i','o','u'))):'an':'a'; ?>
I am sure that I am missing something simple, most likely due to my attempt to insert this fragment among the standard HTML text; can anyone identify my error (s)?
This is the error I am returning:
Parse error: parse error in C: \ Program Files (x86) \ Apache Software Foundation \ Apache2.2 \ htdocs \ testsite \ html \ page.html.php on line 117
Thank!
source
share