Jump to content

Arranging by Letter?


_OwNeD.YoU_

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

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.