colap Posted December 4, 2011 Share Posted December 4, 2011 The older way of doing this, with gconftool-2 doesn’t seem to work anymore in GNOME 3 – used to be something like:<br /><br /> However, there is still possible to change the background image, by using the gsettings tool instead. You will need the libglib2.0-bin package, which is probably already installed on your system. To change the background, use a command like the following: I need to convert the string into=> The older way of doing this, with gconftool-2 doesn’t seem to work anymore in GNOME 3 – used to be something like:<br /><br />However, there is still possible to change the background image, by using the gsettings tool instead. You will need the libglib2.0-bin package, which is probably already installed on your system. To change the background, use a command like the following: How can i do this ? How can i remove that newline character from the middle of the string and concat those two lines and make into one sentence? Quote Link to comment https://forums.phpfreaks.com/topic/252454-how-can-i-concat-two-string-removing-newline-characters-from-mddle-of-the-string/ Share on other sites More sharing options...
Drongo_III Posted December 4, 2011 Share Posted December 4, 2011 You could use: $string = 'The older way of doing this, with gconftool-2 doesn’t seem to work anymore in GNOME 3 – used to be something like:<br /><br />However, there is still possible to change the background image, by using the gsettings tool instead. You will need the libglib2.0-bin package, which is probably already installed on your system. To change the background, use a command like the following:'; $patterns = array(); $patterns[0] = '|<br /><br />|'; $replacements = array(); $replacements[2] = ''; echo preg_replace($patterns, $replacements, $string); That will remove any insteance of your double line break. However, if you're going to use it a bit more widely then you might want to make the regular expression a bit cleverer in that it will currently match precisely the way <br /><br /> is written - spaces and all. But should set you on the right path Quote Link to comment https://forums.phpfreaks.com/topic/252454-how-can-i-concat-two-string-removing-newline-characters-from-mddle-of-the-string/#findComment-1294354 Share on other sites More sharing options...
scootstah Posted December 4, 2011 Share Posted December 4, 2011 $str = str_replace("\n", "", $str); Quote Link to comment https://forums.phpfreaks.com/topic/252454-how-can-i-concat-two-string-removing-newline-characters-from-mddle-of-the-string/#findComment-1294356 Share on other sites More sharing options...
Drongo_III Posted December 4, 2011 Share Posted December 4, 2011 Or that lol... $str = str_replace("\n", "", $str); Quote Link to comment https://forums.phpfreaks.com/topic/252454-how-can-i-concat-two-string-removing-newline-characters-from-mddle-of-the-string/#findComment-1294364 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.