Thread: Preg_replace

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2009
    Posts
    12
    Rep Power
    0

    Preg_replace


    PHP Code:
    $str '
    <div style="cursor:help;" title="header=[Seat/strong 132 ที่นั่ง&nbsp;br /
    strongHoneymoon Seat/strong&nbsp; 63 ที่นั่งbr /
    แบ่งเป็นโซน strongShock Price/strong 66 ที่นั่งbr /
    br /divdiv align=centerimage src='
    http://www.majorcineplex.com/imgUpload/theatre48_1_p5.jpg' width=345 border=0/divBR]">HI</div>';

    $str preg_replace('/^<div style="cursor:help;.*?>/','',$str); 
    i want to strips open div tag <div ...> only
    how can i do that
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2006
    Location
    I'm sneaking up behind you.
    Posts
    1,490
    Rep Power
    832
    Why do we always seek someone, something or some thought? Are we afraid of ourselves?

IMN logo majestic logo threadwatch logo seochat tools logo