 <p>Well, your original code made no sense to begin with as half of the declared variables weren't even being used. Furthermore, it is beyond me why you'd want to convert front-end code into server-side code like this, <code>php</code> is <strong><em>not</em></strong> the right way to do this!</p> <pre><code>if(boothsizerGlobal == 3){ $cellWidth = '112px'; $cellHeight = '52px'; $innerDivElectricTop = '41px'; $innerDivElectricLeft = '110px'; $backgroundImage = 'url(booth_top_images/5X20TOP.jpg)'; $divCode = '&lt;div style="width: ' . $cellWidth . '; height: ' . $cellHeight . '; "'; return $divCode } </code></pre>