oni-kun Posted August 9, 2009 Share Posted August 9, 2009 Imagine I use get_file_contents to place this plaintext into a variable.. Random: Test data: Hello Website: www.example.com ------ Time: 3:23PM Sky: Blue ------ Area: Space ------ END How could I extract..say.. the 'website' line, and what it says after ":" ? I'd prefer if there were a non-regex way if possible with subchar etc but it doesn't matter for it's a simple use, just text getting the 'something:key' to place into a variable.. Pseudocode: $stuff = get_file_contents('./file.txt'); $result = split($stuff, "website"); echo "Contact: <a href="$result">$result</a>"; Quote Link to comment https://forums.phpfreaks.com/topic/169470-how-do-i-search-and-extract-text/ 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.