newbtophp Posted October 14, 2009 Share Posted October 14, 2009 How would i replace: (); if its on its own line, without effecting other code, i tried str_replace but that would replace other code even if its not on its own line, for example: <?php include_once("application.php"); (); $account = new Account(); (); $accounts_4_sale = new ProductListing(); $limit = RECORD_PER_PAGE; $start = isset($_GET['pagenum']) ? ($_GET['pagenum'] - 1) * $limit : 0; (); $content = new Content(); include_once(THEME_PAGES_DIR."page_structure.html"); ?> Would turninto: <?php include_once("application.php"); $account = new Account(); $accounts_4_sale = new ProductListing(); $limit = RECORD_PER_PAGE; $start = isset($_GET['pagenum']) ? ($_GET['pagenum'] - 1) * $limit : 0; $content = new Content(); include_once(THEME_PAGES_DIR."page_structure.html"); ?> All help greatly apreciated Link to comment https://forums.phpfreaks.com/topic/177675-solved-replace-a-character-new-lines/ Share on other sites More sharing options...
nrg_alpha Posted October 14, 2009 Share Posted October 14, 2009 Perhaps a pattern like: #^\(\);\s*$#m ? Link to comment https://forums.phpfreaks.com/topic/177675-solved-replace-a-character-new-lines/#findComment-936838 Share on other sites More sharing options...
newbtophp Posted October 14, 2009 Author Share Posted October 14, 2009 Thanks worked nicely Link to comment https://forums.phpfreaks.com/topic/177675-solved-replace-a-character-new-lines/#findComment-936853 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.