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>"; 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
Archived
This topic is now archived and is closed to further replies.