Jump to content

[SOLVED] Replace a character new lines


newbtophp

Recommended Posts

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  :D

Link to comment
https://forums.phpfreaks.com/topic/177675-solved-replace-a-character-new-lines/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.