HTML - avoiding new lines

Soldato
Joined
24 Nov 2002
Posts
16,378
Location
38.744281°N 104.846806°W
Why when you having something like:
Code:
MKTFLILALLAIVATTATSAVRVPVPQLQPQNPSQQQPQEQVPLMQQQQQFPGQQEQFPPQQPYPHQQPFPSQQPYPQPQPFP-PQLPYPQTQ-PFPPQQPYPQPQPQYP-------QPQQPISQQQAQQQQQQQQ-------TLQQILQQQLIPCRDVVLQQHNIAHASSQVLQQSSYQQLQQLCCQQLFQIPEQSRCQAIHNVVHAIILHHH-------------------------QQQQQQPSSQVSYQQPQEQYPSGQVSFQSSQQNPQAQGSVQPQQLPQFQEIRNLALQTLPAMCNVYIPPYCSTTIAPFGIFGTN

Does HTML break it up onto multiple lines?

And is there a way to avoid this?
 
Okay, no point for a new thread.

I have the same line:

Code:
MASINRPIVFFTVCLFLLCNGSLAQQLLGQSTSQWQSSRRGSPRECRFDRLQAFEPIRSVRSQAGTTEFFDVSNEQFQCTGVSVVRRVIEPRGLLLPHYTNGASLVYIIQGRGITGPTFPGCPESY----------------------------------QQQFQQSGQAQLTESQSQSQKFKDEHQKIHRFRQGDVIALPAGVAHWCYNDGEVPVVAIYVTDLNNGANQLDPRQRDFLLAGNKRN---PQAYRREVEERS-QNIFSGFSTELLSEALGVSGQVARQLQCQNDQRGEIVRVEHGLSLLQP----------------------------------YASLQEQEQGQVQSRERYQEGQYQQSQYGSGCSNGLDETFCTLRVRQNIDNPNRADTYNPRAGRVTNLNTQNFPILSLVQMSAVKVNLYQNALLSPFWNINAHSVVYITQGRARVQVVNNNGKTVFNGELRRGQLLIIPQHYAVVKKA-QREGCAYIAFKTNPNSMVSHIAGKSSIFRALPNDVLANAYRISREEAQRLKHNRGDEFGAFTPIQYKSYQDVYNAAESS*

And using php I'd like to identify all repeating -'s and store:
1) position of first - in group
2) position of last - in group
3) therefore string length of group.

E.g. first group would have values:

start 126
end 160
width 34

Naturally start and width can be deduced by:

Code:
$start = strpos(trim($seqrow['seq']), "-");
$width = substr_count(trim($seqrow['seq']), '-', $start, $end-$start);

But I'm completely stumped for $end.... as it isn't the last '-' in the string.. only the last in the substring.
 
Dj_Jestar said:
Code:
$end = strrpos($substring, '-');
That will give me the last in the string though, not the substring...

string: "abcd-----efghi---jk....."

It would give me the position of j-1, not e-1.
 
Code:
$substrings = preg_split('/-+/', $string);

foreach ($substrings as $substring) {
    echo "Len of $substring is: " . strlen($substring);
}
 
Back
Top Bottom