duall Posted September 19, 2006 Share Posted September 19, 2006 hi,i have some long strings like[quote]{{{[adena];3504;7154;100}};70};{{{[soul_separator];1;1;0.2693};{[soul_separator_head];1;1;99.7307}};0.3539};{{{[crafted_leather];1;1;4.7683};{[mold_glue];1;1;4.5299};{[mold_hardener];1;1;1.1817};{[thons];1;1;4.5299};{[scrl_of_ench_am_s];1;1;0.0544};{[mithril_arrow];20;60;84.9358}};31.5556}[/quote]i want to select one line from the string like:[quote]{{{[soul_separator];1;1;0.2693};{[soul_separator_head];1;1;99.7307}};0.3539}[/quote]Which starts with {{{[ And ends with }};anyNumber}PS: the line should be selected by a keyword like: [soul_seperator] or [soul_separator_head] or [anyword] Quote Link to comment https://forums.phpfreaks.com/topic/21288-help-get-data-from-string/ Share on other sites More sharing options...
HuggieBear Posted September 19, 2006 Share Posted September 19, 2006 You'd be wise to use a regular expression here.Have a look at the [url=http://www.php.net/manual/en/ref.pcre.php]RegEx[/url] section in the manual.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21288-help-get-data-from-string/#findComment-94703 Share on other sites More sharing options...
duall Posted September 19, 2006 Author Share Posted September 19, 2006 any ideas a script or sth.. Quote Link to comment https://forums.phpfreaks.com/topic/21288-help-get-data-from-string/#findComment-94860 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.