i have a variable $str whose print_r gives <string xmlns="http://xxxx.com/xx/xx/Serialization/">This is my string</string> Code (markup): i want to build a variable $str2 which whould be equal to = "This is my string" (removing the string tags..) how can i build my $str2.. i tried preg_replace but was somehow not getting it,. may be due to regex error,. tgough my regex is good can some one gives the required lines of code,. is there a better and faster way than preg_replace.
$str = '<string xmlns="http://xxxx.com/xx/xx/Serialization/">This is my string</string>'; $rslt = strip_tags($str); echo $rslt; PHP: