-
PHP's number_format() with
PHP’s
number_format()can’t take a as a separator, which is bad when you want the separator to be whitespace inside HTML, since using a normal blank (a ” “) breaks the number when it happens to be laid out between to lines.Svein Tjonndal has written the following little function which essentially does a
number_formatwith as the thousands separator:function numberfix($number) { $number = number_format($number,0,","," "); return str_replace(" ", " ", $number); } -
Universalin jättiyllätys: ilmaista musiikkia netistä
Yksi maailman neljästä musiikkijätistä, Universal Music, on tehnyt sopimuksen uuden Spiralfrog-nettipalvelun kanssa, joka tuo internetiin ilmaiset lailliset musiikkilataukset. Joulukuussa avattava musiikkipalvelu on täysin mainosrahoitteinen ja musiikki on ilmaista. [Mainoksien katselun] jälkeen kappaleen saa
omaksi
, eli sen voi tallentaa kiintolevylle ja musiikkisoittimille.Tietokone
linkitys omani -
UTF-8 substr fot PHP
“[Pulling] out an arbitrary substring which happens to cut a 2 byte UTF-8 sequence breaks the string;
<?php header ('Content-type: text/html; charset=utf-8'); $haystack = 'Iñtërnâtiônàlizætiøn'; // Position 13 is in the middle of the ô char $substr = substr($haystack, 0, 13); print "Substr: $substr<br>";
$substrnow contains badly formed UTF-8 and your browser should display something wierd as a result (probably a ?)”Handling UTF-8 with PHP”
phpwact.orga comment moved due to layout issues
To go around this limitation, I used the following replacement substr code, which I extracted from “UTF-8 friendly replacement functions” v0.2, by Niels Leenheer & Andy Matsubara. For some reason, at the time of writing this, Google only seems to find a PDF version of this document.
function substr($str, $start , $length = NULL) { preg_match_all('/[\x01-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF][\x80-\xBF]/', $str, $arr); if (is_int($length)) return implode('', array_slice($arr[0], $start, $length)); else return implode('', array_slice($arr[0], $start)); } -
Subtitle timings for .srt's with ProjectX
Afterdawn’s ProjectX guide told me to select
re-build TTX-PTS from 1st MpgAudio stream…
in the PreSettings, so I did, and voilá! Now I don’t have to time the subtitles manually with VisualSubSync anymore. What a waste of effort that proved to be! -
Microsoft puts police link on Messenger
Users of Microsoft’s Messenger email service will be able to report suspected sexual predators directly to the police at the click of a mouse. […] Microsoft will add a
report abuse
icon to Messenger that will link any users worried about their anonymous internet buddies directly to online police services. -
freenigma
Freenigma promises to provide encryption for major webmail services such as GMail, Yahoo! Mail and Hotmail, using a simple to set-up Firefox extension. (Via Killinki)