codeigniter - php escape characters, replacing string content with image source tag -


<?php echo anchor($this->lang->switch_uri($switchlang), "switch language" ?> 

i want replace switch language message country flag.

how can escape characters , display img src inside string message

<?php echo anchor($this->lang->switch_uri($switchlang), "<img src='/somepath.jpg')"; ?> 

thanks

try this:

<?php echo anchor($this->lang->switch_uri($switchlang), "<img src=\'/somepath.jpg\'"); ?> 
  1. moved trailing double quotes inside bracket
  2. added escape slashes single quotes

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -