lxndr Posted June 2, 2006 Share Posted June 2, 2006 I have a series of song titles stored in an SQL database and want to be able to split one of the fields as follows:before:title: California, Here I Come (1924 version)comment:after:title: California, Here I Comecomment: (1924 version)So, what I need to be able to do is check if the title contains " version)" and if so I want to work out where the bracketed information starts and remove it from the song title (discarding the space before it) and place the bracketed information in another field. The bit I'm struggling with is determing where the bracketed information (containing the word 'version') starts because there could be other bracketed info in the song title too, e.g.:California, Here I Come (1924 version) (worn)or California, Here I Come (worn) (1924 version)Any help would be much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/11016-string-splitting-query/ Share on other sites More sharing options...
redarrow Posted June 2, 2006 Share Posted June 2, 2006 [!--quoteo(post=379296:date=Jun 2 2006, 11:43 AM:name=lxndr)--][div class=\'quotetop\']QUOTE(lxndr @ Jun 2 2006, 11:43 AM) [snapback]379296[/snapback][/div][div class=\'quotemain\'][!--quotec--]I have a series of song titles stored in an SQL database and want to be able to split one of the fields as follows:before:title: California, Here I Come (1924 version)comment:after:title: California, Here I Comecomment: (1924 version)So, what I need to be able to do is check if the title contains " version)" and if so I want to work out where the bracketed information starts and remove it from the song title (discarding the space before it) and place the bracketed information in another field. The bit I'm struggling with is determing where the bracketed information (containing the word 'version') starts because there could be other bracketed info in the song title too, e.g.:California, Here I Come (1924 version) (worn)or California, Here I Come (worn) (1924 version)Any help would be much appreciated.[/quote]wouldint be a lot easer to get rid of all brackets use str_repalce. Quote Link to comment https://forums.phpfreaks.com/topic/11016-string-splitting-query/#findComment-41135 Share on other sites More sharing options...
lxndr Posted June 2, 2006 Author Share Posted June 2, 2006 [!--quoteo(post=379297:date=Jun 2 2006, 12:49 PM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Jun 2 2006, 12:49 PM) [snapback]379297[/snapback][/div][div class=\'quotemain\'][!--quotec--]wouldint be a lot easer to get rid of all brackets use str_repalce.[/quote]No, I need to do it the way I described. Quote Link to comment https://forums.phpfreaks.com/topic/11016-string-splitting-query/#findComment-41138 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.