1

I need to put some cobinated HTML PHP code in the second parameter of the str_replace function in CodeIgniter.

<a href="<?=base_url();?>pages/articles/<?=str_replace($replace_simbols, '-', $category);?>.html" ></a>

<dt><?=character_limiter($categoryEntry1[2],110).'<a href="NEED TO PUT HERE ATRIBUTE FROM FIRST a href" >'.'<img class="read_more" src="/img/read_more.png" alt="read more" title="Read more..." /></a>'?></dt>

$replace_symbols , var contain (some symbols).

How can I do this?

2
  • cant you urlencode(thestring)? Commented Feb 2, 2013 at 2:21
  • Thank you mithunsatheesh for editing. Sorry for my bad english. Commented Feb 2, 2013 at 2:23

2 Answers 2

3

Why not just put everything in a variable? Btw since when does codeigniter have .html extension

$href_link = base_url() . "pages/articles/" . str_replace($replace_simbols, '-', $category);
<a href="<?=$href_link;?>.html" ></a>

 <dt><?=character_limiter($categoryEntry1[2],110).'<a href="<?=$href_link;?>.html">'.'<img class="read_more" src="/img/read_more.png" alt="read more" title="Read more..." /></a>'?></dt>
Sign up to request clarification or add additional context in comments.

Comments

2

Try:

$href = base_url() . "pages/articles/" . str_replace($replace_simbols, '-', $category) . ".html";

<a href="<?php echo $href;?>"></a>

<dt><?=character_limiter($categoryEntry1[2],110).'<a href="' . $href . '" >'.'<img class="read_more" src="/img/read_more.png" alt="read more" title="Read more..." /></a>'?></dt>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.