mysterbx Posted January 24, 2008 Share Posted January 24, 2008 Hello, I need some help with a code, i need a code, that would remove the first line and show others... Example: $text = "line1\nline2\nline3\nline4\n"; Output: line2 line3 line4 (line1 has to be removed with some code, maybe preg_replace... i dont know... thats why im asking ) Any help would be great Link to comment https://forums.phpfreaks.com/topic/87644-remove-lines-from-variable/ Share on other sites More sharing options...
jorgep Posted January 24, 2008 Share Posted January 24, 2008 $text = "line1\nline2\nline3\nline4\n"; $lines = explode("\n",$text); unset($lines[0]); $final_text = implode("\n",$lines); Link to comment https://forums.phpfreaks.com/topic/87644-remove-lines-from-variable/#findComment-448268 Share on other sites More sharing options...
mysterbx Posted January 24, 2008 Author Share Posted January 24, 2008 Works 100%! THANKS A LOT! Link to comment https://forums.phpfreaks.com/topic/87644-remove-lines-from-variable/#findComment-448287 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.