Need help with STR REPLACE function...easy one

Discussion in 'PHP' started by becoolufull99, Jun 23, 2010.

  1. #1
    I am having a wordpress blog....What I want is need to remove colon) from a link


    Now when the my post page executes the <?php wp_title('', true, 'right'); ?> will fetch the title of the page.

    This also fetches colon) in the title which I need to remove in this link

    mysite.com/<?php wp_title('', true, 'right'); ?>

    please let me know the code.
     
    becoolufull99, Jun 23, 2010 IP
  2. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Hi,

    If I understood right:
    
    mysite.com/<?php echo str_replace(')','',wp_title('', false, 'right')); ?>
    
    PHP:
    should do the trick.
    Regards :)
     
    koko5, Jun 23, 2010 IP
  3. georgiivanov

    georgiivanov Member

    Messages:
    62
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    25
    #3
    georgiivanov, Jun 23, 2010 IP
  4. becoolufull99

    becoolufull99 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    @georgeiivanov
    Permalink contains dashes which I dont need. So its easy to remove this colon
    @koko
    The code gave the same value.

    I figured it out and was able to remove the : (colon) but met with another problem.

    The output is
    mysite.com/THE POST TITLE .html the extra TWO spaces before .HTML. I want to remove them.

    The code I used is
    Please correct the code.
     
    becoolufull99, Jun 23, 2010 IP