Forum Moderators: coopster

Message Too Old, No Replies

str replace

         

nanat

1:42 pm on Nov 22, 2009 (gmt 0)

10+ Year Member



how can replace this? its seem doesn't work with me.. anybody?

$statement = array("[/list]","[list=2]"," http://", );
$replace = array("</list>","<list=2>","<img src="http://test.gif">","</img>");

original post:
List:


[list=1]
  • list item
    [/list]
  • image:


    http://test.gif

    StoutFiles

    4:55 am on Nov 25, 2009 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    $statement = array("[/list]","[list=1]"," ", );
    $replace = array('</li>','<li>','<img src="','">');

    $post = str_replace($statement, $replace, $post);

    nanat

    1:14 am on Nov 26, 2009 (gmt 0)

    10+ Year Member



    hi SoutFiles how

    replacing:
    [list=1]
  • Coffee
    [/list]

  • to :

    <ol>
    <li>Coffee</li>
    </ol>

    StoutFiles

    12:31 pm on Nov 30, 2009 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    $statement = array("[/list]","[list=1]"," ", );
    $replace = array('</li></ol>','<ol><li>','<img src="','">');

    $post = str_replace($statement, $replace, $post);