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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -