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? 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 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); 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); 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
Archived
This topic is now archived and is closed to further replies.