How to convert Interval to _

Discussion in 'PHP' started by a4kata, Jul 22, 2009.

  1. #1
    Hello I want to convert the intervals in my url as _ . For example I have : <a href=\"http://mysite.com/".$data["name"]."\" > ... $data["name"] is equal to "test url" I want to be "test_url" Any help ? Thanks in advance and sorry for my bad english
     
    a4kata, Jul 22, 2009 IP
  2. Martinoes

    Martinoes Peon

    Messages:
    110
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this.
    
    <?php
    $text = "test test		 test ";
    
    $text = ereg_replace('[[:blank:]]', '_', $text);
    
    echo $text;
    ?>
    
    PHP:
     
    Martinoes, Jul 22, 2009 IP