PHPTOM Posted February 13, 2009 Share Posted February 13, 2009 Hi, Basically I have a huge multi-line variable and I want to trim the top line off it. Here is an example: <?PHP $var = "line1 line2 line3 line4"; ?> And I want it just to be <?PHP $var = "line2 line3 line4"; ?> The first line changes, so I cant do explode or anything. Thanks Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 13, 2009 Share Posted February 13, 2009 <?php $var = "line1 line2 line3 line4"; $var = preg_replace('/^.*\n/','',$var); print $var; ?> Quote Link to comment Share on other sites More sharing options...
PHPTOM Posted February 13, 2009 Author Share Posted February 13, 2009 Great. Thanks! Quote Link to comment 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.