[ create a new paste ] login | about

Link: http://codepad.org/qvZvbFJi    [ raw code | output | fork ]

PHP, pasted on Jul 29:
1
2
3
4
5
6
7
8
<?php

    
    $class = the_field('status') == 'new' ? 'status' : 'statusSold';

    echo '<span class="' . $class . '">' . the_field('status') . '</span>';

    function the_field($str) {return 'new';} // just a mock function for testing purposes 


Output:
1
<span class="status">new</span>


Create a new paste based on this one


Comments: