PHP Echo shorthand is removing all forward slashes -


here section of code should add background image label, reason when start using <?= shorthand, of forward slashes being removed:

<label for="<?=$result_id?>_checkbox" id="<?=$result_id?>_label" style="background-image:url("<?=$img?>");" /> 

here code generates url:

$img = $_session['root_dir']."data/images/".$folder."/".$result_imageset."/".str_replace(" ", "%20", $result_jpg); 

this $img variable generates:

http://localhost:1234/ppa/data/images/20140130/0/rmeuvh3.jpg 

edit:

echo var_dump(ini_get('short_hand_tags')); 

produces:

bool(false)

although, following works...

<div class="jpg"><?=$result_jpg?></div> 

have @ source code of page being generated. works me, in sense forward slashes not removed.

however there problem code:

style="background-image:url("<?=$img?>");"

you have double quotes within double quotes. not work :)

you want instead

style="background-image:url('<?=$img?>');" <-- inner double quotes replaced single quotes.

other code renders expected.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -