htmltoolkit

alpha chrc2 if c3 alpha chrc3

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: code $regexp = '/(<br[ \/]?[\/]?>)+?<\/div>/si'; //<?//fix PSPAD highlight bug $html = preg_replace($regexp,'</div>',$html); return $html; } function dec2alpha($valor,$toupper="true"){ // returns a string from AZ to AAZZ to AAAZZZ // OBS: A = 65 ASCII TABLE VALUE if (($valor < 1) || ($valor > 18278)) return "?"; //supports 'only' up to 18278 $c1 = $c2 = $c3 = ''; if ($valor > 702) // 3 letters (up to 18278) { $c1 = 65 + floor(($valor703)/676); $c2 = 65 + floor((($valor703)%676)/26); $c3 = 65 + floor((($valor703)%676)%26); } elseif ($valor > 26) // 2 letters (up to 702) { $c1 = (64 + (int)(($valor1) / 26)); $c2 = (64 + (int)($valor % 26)); if ($c2 == 64) $c2 += 26; } else // 1 letter (up to 26) { $c1 = (64 + $valor); } $alpha = chr($c1); if ($c2 != '') $alpha .= chr($c2); if ($c3 != '') $alpha .= chr($c3); if (!$toupper) $alpha = strtolower($alpha); return $alpha; } function dec2roman($valor,$toupper=true){ //returns a string as a roman numeral if (($valor >= 5000) || ($valor < 1)) return "?"; //supports 'only' up to 4999 $aux = (int)($valor/1000); if ($aux!==0) { $valor %= 1000; while($aux!==0) { $r1 .= "M"; $aux; } } $aux = (int)($valor/100); if ($aux!==0) { $valor %= 100; switch($aux){ case 3: $r2="C"; case 2: $r2.="C"; case 1: $r2.="C"; break; case 9: $r2="CM"; break; case 8: $r2="C"; case 7: $r2.="C"; case 6: $r2.="C"; case...
View Full Document

Ask a homework question - tutors are online