# Fixing PHP Syntax

**URL:** <https://forum.kirupa.com/t/fixing-php-syntax/331901>\
**Category:** programming\
**Created:** [November 21, 2013, 3:22am UTC](https://forum.kirupa.com/t/fixing-php-syntax/331901 "2013-11-21T03:22:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)\
**Post date:** [November 21, 2013, 3:22am UTC](https://forum.kirupa.com/t/fixing-php-syntax/331901/1 "2013-11-21T03:22:38Z")

</div>

I need to use PHP to set a conditional and change the css style for the following element:

\<h3 id=“h3\_g\_\<?= $gall[“url”] ?\>” class=“ir”\>\<?= $gall[“name”] ?\>\</h3\>

Something like:

```auto

<?php
         if ($workpage) {
             print("<h3 id=\"h3_g_<?= $gall[\"url\"] ?>\" class=\"ir\" style=\"top:59px!important;\"><?= $gall[\"name\"] ?></h3>");
         } else {
             print("<h3 id=\"h3_g_<?= $gall[\"url\"] ?>\" class=\"ir\"><?= $gall[\"name\"] ?></h3>");
         }
?>

```

However, I don’t have the syntax right. Another option would be to assign a different class (rather than try to use an inline style). I could use some help with the syntax first.
