Jump to content

Recommended Posts

What exactly are you trying to do?

 

If this is in a database, why not put UCUS-98646 Killzone Liberation [uS] into 3 seperate fields?

 

IE:

UCUS-98646 in a field called "code"

Killzone Liberation in a field called "title"

US in a field called "country"

 

That will save you tremendous heartache of parsing etc and will allow for easy searchability etc. And you can easily rebuild the string to look like it does above.

Link to comment
https://forums.phpfreaks.com/topic/135405-arranging-by-letter/#findComment-705292
Share on other sites

$text = $data[title];

  if(preg_match('/^([^\s]+)\s+(.+)\s+\[(..)\]$/',$text,$matches)){

    list(,$code,$title,$country) = $matches;

 

did that but how would i just show all $title begining with the letter k

 

Huh?

 

If you are looking to only grab what is after UCUS-98646 as the start of your search, then you need to use RegEx.  I assume your title is the entire line you posted?

 

Is the format always the same?

format is the entire line, format is also always the same

Link to comment
https://forums.phpfreaks.com/topic/135405-arranging-by-letter/#findComment-705298
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.