raila Posted April 9, 2006 Share Posted April 9, 2006 I have a textfile that contains the following:< 0> Brann< 0> Fredrikstad<4> vikingi whant to separate the "< 0>" (everything between < & >) and the "Name" after the < & >When i have separated the string i whant to echo"Name" (i.e Brann or Fredrikstad or viking)whitout the < > and everything between them.Need all the help i kan get.thank Raila. Link to comment https://forums.phpfreaks.com/topic/6956-separate-strings/ Share on other sites More sharing options...
Barand Posted April 9, 2006 Share Posted April 9, 2006 try[code]$str = '< 0> Fredrikstad';list(,$number,$name) = split ('[<>]', $str);echo $number; // --> 0echo $name; // --> Fredrikstad[/code] Link to comment https://forums.phpfreaks.com/topic/6956-separate-strings/#findComment-25317 Share on other sites More sharing options...
raila Posted April 12, 2006 Author Share Posted April 12, 2006 Thanks for te help :-) Link to comment https://forums.phpfreaks.com/topic/6956-separate-strings/#findComment-26308 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.