Page 1 of 1

how to count 1 tone from , to ,

Posted: Sun Jul 06, 2003 7:21 am
by GK
Hi all

i count my tones in my ringtones with this

<?php

if(strlen($site_rtttl)>$site_check) {

?>

Site check contains the value (ex. 220)
but this check the caracters and i need to get the tones

This is whats inputted (an example rtttl)

Dearm:d=16, o=5, b=90:4a, 8g, f, 4p, 8p, 4a, 8a#, 8a, 8g, 8f, 8g, 8a, 8p, 4a, 8g, f, 4p, 8p, 4a, 8a#, 8a, 8g, 8f, 8g, 8a, 8p, 4a, 8g, f, 4p, 8p, 4a, 8a#, 8a, 8g, 8f, g,


Dearm = name
d= duration
o= something LOL
b= speed
then each tone is seperated bij ,

How do i count starting at : and then 1 count is from , to ,

?? :?:

Posted: Sun Jul 06, 2003 3:34 pm
by m@ndio
why are you using strlen if the value of $site_rtttl is numeric? strlen count the number of characters in a string...

Posted: Sun Jul 06, 2003 3:49 pm
by m3rajk
umm.. try....

Code: Select all

<?php
$temp=explode($site_rtttl, ',');
foreach($temp as $value){
  $value=trim($value);
}
?>
now it is an array... entries look like....
Dearm:d=16
o=5
b=90:4a
8g
f
4p
...


count($temp); is, fromt he sound of it, what you're alooking for (not the length of the string)
and since you know the first 3 are always
Dearm:d=16
o=5
b=90:4a
you can figure out that count($temp)-3; is what you want if you want ot skip them. if you want to evaluate something you can easily skip over to the point you want to evaluate if there's other parts set

Re: how to count 1 tone from , to ,

Posted: Sun Jul 06, 2003 3:52 pm
by m@ndio
Site check contains the value (ex. 220)
but this check the caracters and i need to get the tones
didn't see that sorry .. :oops: