Archive for category Article

PHP Error Logging

Log errors to a file, and prevent showing them to the user. Make sure that the file exists and youre able to write to it.

# display no errs to user
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
# log to file
php_flag log_errors on
php_value error_log /location/to/php_error.log

Glyphs

Special Characters

"""quotation marku+0022 ISOnump:before { content:"\0022"; }alert("\42")
&&&ampersandu+0026 ISOnump:before { content:"\0026"; }alert("\46")
&lt ;&#60;<less-than signu+003C ISOnump:before { content:"\003c"; }alert("\74");
&gt ;&#62;>greater-than signu+003E ISOnump:before { content:"\003e"; }alert("\76");

Latin-1 entity set for HTML

Name NumericDescriptionHexISO in CSS contentOctal
&nbsp; &#160;no-break space%A0p:before { content:"\00a0"; }alert("\240");
&iexcl;¡&#161;inverted exclamation mark%A1p:before { content:"\00a1"; }alert("\241");
&cent;¢&#162;cent sign%A2p:before { content:"\00a2"; }alert("\242");
&pound;£&#163;pound sterling sign%A3p:before { content:"\00a3"; }alert("\243");
&curren;¤&#164;general currency sign%A4p:before { content:"\00a4"; }alert("\244");
&yen;¥&#165;yen sign%A5p:before { content:"\00a5"; }alert("\245");
&brvbar;¦&#166;broken (vertical) bar%A6p:before { content:"\00a6"; }alert("\246");
&sect;§&#167;section sign%A7p:before { content:"\00a7"; }alert("\247");
&uml;¨&#168;umlaut (dieresis)%A8p:before { content:"\00a8"; }alert("\250");
&copy;©&#169;copyright sign%A9p:before { content:"\00a9"; }alert("\251");
&ordf;ª&#170;ordinal indicator, feminine%AAp:before { content:"\00aa"; }alert("\252");
&laquo;«&#171;angle quotation mark, left%ABp:before { content:"\00ab"; }alert("\253");
&not;¬&#172;not sign%ACp:before { content:"\00ac"; }alert("\254");
&shy;­&#173;soft hyphen%ADp:before { content:"\00ad"; }alert("\255");
&reg;®&#174;registered sign%AEp:before { content:"\00ae"; }alert("\256");
&macr;¯&#175;macron%AFp:before { content:"\00af"; }alert("\257");
&deg;°&#176;degree sign%B0p:before { content:"\00b0"; }alert("\260");
&plusmn;±&#177;plus-or-minus sign%B1p:before { content:"\00b1"; }alert("\261");
&sup2;²&#178;superscript two%B2p:before { content:"\00b2"; }alert("\262");
&sup3;³&#179;superscript three%B3p:before { content:"\00b3"; }alert("\263");
&acute;´&#180;acute accent%B4p:before { content:"\00b4"; }alert("\264");
&micro;µ&#181;micro sign%B5p:before { content:"\00b5"; }alert("\265");
&para;&#182;pilcrow (paragraph sign)%B6p:before { content:"\00b6"; }alert("\266");
&middot;·&#183;middle dot%B7p:before { content:"\00b7"; }alert("\267");
&cedil;¸&#184;cedilla%B8p:before { content:"\00b8"; }alert("\270");
&sup1;¹&#185;superscript one%B9p:before { content:"\00b9"; }alert("\271");
&ordm;º&#186;ordinal indicator, masculine%BAp:before { content:"\00ba"; }alert("\272");
&raquo;»&#187;angle quotation mark, right%BBp:before { content:"\00bb"; }alert("\273");
&frac14;¼&#188;fraction one-quarter%BCp:before { content:"\00bc"; }alert("\274");
&frac12;½&#189;fraction one-half%BDp:before { content:"\00bd"; }alert("\275");
&frac34;¾&#190;fraction three-quarters%BEp:before { content:"\00be"; }alert("\276");
&iquest;¿&#191;inverted question mark%BFp:before { content:"\00bf"; }alert("\277");
&Agrave;À&#192;capital A, grave accent%C0p:before { content:"\00c0"; }alert("\300");
&Aacute;Á&#193;capital A, acute accent%C1p:before { content:"\00c1"; }alert("\301");
&Acirc;Â&#194;capital A, circumflex accent%C2p:before { content:"\00c2"; }alert("\302");
&Atilde;Ã&#195;capital A, tilde%C3p:before { content:"\00c3"; }alert("\303");
&Auml;Ä&#196;capital A, dieresis or umlaut mark%C4p:before { content:"\00c4"; }alert("\304");
&Aring;Å&#197;capital A, ring%C5p:before { content:"\00c5"; }alert("\305");
&AElig;Æ&#198;capital AE diphthong (ligature)%C6p:before { content:"\00c6"; }alert("\306");
&Ccedil;Ç&#199;capital C, cedilla%C7p:before { content:"\00c7"; }alert("\307");
&Egrave;È&#200;capital E, grave accent%C8p:before { content:"\00c8"; }alert("\310");
&Eacute;É&#201;capital E, acute accent%C9p:before { content:"\00c9"; }alert("\311");
&Ecirc;Ê&#202;capital E, circumflex accent%CAp:before { content:"\00ca"; }alert("\312");
&Euml;Ë&#203;capital E, dieresis or umlaut mark%CBp:before { content:"\00cb"; }alert("\313");
&Igrave;Ì&#204;capital I, grave accent%CCp:before { content:"\00cc"; }alert("\314");
&Iacute;Í&#205;capital I, acute accent%CDp:before { content:"\00cd"; }alert("\315");
&Icirc;Î&#206;capital I, circumflex accent%CEp:before { content:"\00ce"; }alert("\316");
&Iuml;Ï&#207;capital I, dieresis or umlaut mark%CFp:before { content:"\00cf"; }alert("\317");
&ETH;Ð&#208;capital Eth, Icelandic%D0p:before { content:"\00d0"; }alert("\320");
&Ntilde;Ñ&#209;capital N, tilde%D1p:before { content:"\00d1"; }alert("\321");
&Ograve;Ò&#210;capital O, grave accent%D2p:before { content:"\00d2"; }alert("\322");
&Oacute;Ó&#211;capital O, acute accent%D3p:before { content:"\00d3"; }alert("\323");
&Ocirc;Ô&#212;capital O, circumflex accent%D4p:before { content:"\00d4"; }alert("\324");
&Otilde;Õ&#213;capital O, tilde%D5p:before { content:"\00d5"; }alert("\325");
&Ouml;Ö&#214;capital O, dieresis or umlaut mark%D6p:before { content:"\00d6"; }alert("\326");
&times;×&#215;multiply sign%D7p:before { content:"\00d7"; }alert("\327");
&Oslash;Ø&#216;

capital O, slash

%D8p:before { content:"\00d8"; }alert("\330");
&Ugrave;Ù&#217;capital U, grave accent%D9p:before { content:"\00d9"; }alert("\331");
&Uacute;Ú&#218;capital U, acute accent%DAp:before { content:"\00da"; }alert("\332");
&Ucirc;Û&#219;capital U, circumflex accent%DBp:before { content:"\00db"; }alert("\333");
&Uuml;Ü&#220;capital U, dieresis or umlaut mark%DCp:before { content:"\00dc"; }alert("\334");
&Yacute;Ý&#221;capital Y, acute accent%DDp:before { content:"\00dd"; }alert("\335");
&THORN;Þ&#222;capital THORN, Icelandic%DEp:before { content:"\00de"; }alert("\336");
&szlig;ß&#223;small sharp s, German (sz ligature)%DFp:before { content:"\00df"; }alert("\337");
&agrave;à&#224;small a, grave accent%E0p:before { content:"\00e0"; }alert("\340");
&aacute;á&#225;small a, acute accent%E1p:before { content:"\00e1"; }alert("\341");
&acirc;â&#226;small a, circumflex accent%E2p:before { content:"\00e2"; }alert("\342");
&atilde;ã&#227;small a, tilde%E3p:before { content:"\00e3"; }alert("\343");
&auml;ä&#228;small a, dieresis or umlaut mark%E4p:before { content:"\00e4"; }alert("\344");
&aring;å&#229;small a, ring%E5p:before { content:"\00e5"; }alert("\345");
&aelig;æ&#230;small ae diphthong (ligature)%E6p:before { content:"\00e6"; }alert("\346");
&ccedil;ç&#231;small c, cedilla%E7p:before { content:"\00e7"; }alert("\347");
&egrave;è&#232;small e, grave accent%E8p:before { content:"\00e8"; }alert("\350");
&eacute;é&#233;small e, acute accent%E9p:before { content:"\00e9"; }alert("\351");
&ecirc;ê&#234;small e, circumflex accent%EAp:before { content:"\00ea"; }alert("\352");
&euml;ë&#235;small e, dieresis or umlaut mark%EBp:before { content:"\00eb"; }alert("\353");
&igrave;ì&#236;small i, grave accent%ECp:before { content:"\00ec"; }alert("\354");
&iacute;í&#237;small i, acute accent%EDp:before { content:"\00ed"; }alert("\355");
&icirc;î&#238;small i, circumflex accent%EEp:before { content:"\00ee"; }alert("\356");
&iuml;ï&#239;small i, dieresis or umlaut mark%EFp:before { content:"\00ef"; }alert("\357");
&eth;ð&#240;small eth, Icelandic%F0p:before { content:"\00f0"; }alert("\360");
&ntilde;ñ&#241;small n, tilde%F1p:before { content:"\00f1"; }alert("\361");
&ograve;ò&#242;small o, grave accent%F2p:before { content:"\00f2"; }alert("\362");
&oacute;ó&#243;small o, acute accent%F3p:before { content:"\00f3"; }alert("\363");
&ocirc;ô&#244;small o, circumflex accent%F4p:before { content:"\00f4"; }alert("\364");
&otilde;õ&#245;small o, tilde%F5p:before { content:"\00f5"; }alert("\365");
&ouml;ö&#246;small o, dieresis or umlaut mark%F6p:before { content:"\00f6"; }alert("\366");
&divide;÷&#247;divide sign%F7p:before { content:"\00f7"; }alert("\367");
&oslash;ø&#248;small o, slash%F8p:before { content:"\00f8"; }alert("\370");
&ugrave;ù&#249;small u, grave accent%F9p:before { content:"\00f9"; }alert("\371");
&uacute;ú&#250;small u, acute accent%FAp:before { content:"\00fa"; }alert("\372");
&ucirc;û&#251;small u, circumflex accent%FBp:before { content:"\00fb"; }alert("\373");
&uuml;ü&#252;small u, dieresis or umlaut mark%FCp:before { content:"\00fc"; }alert("\374");
&yacute;ý&#253;small y, acute accent%FDp:before { content:"\00fd"; }alert("\375");
&thorn;þ&#254;small thorn, Icelandic%FEp:before { content:"\00fe"; }alert("\376");
&yuml;ÿ&#255;small y, dieresis or umlaut mark%FFp:before { content:"\00ff"; }alert("\377");

Latin Extended-A

&OElig;Œ&#338;latin capital ligature oeu+0152 ISOlat2p:before { content:"\0152"; }alert("\u0152");
&oelig;œ&#339;latin small ligature oe
(ligature is a misnomer, this is a separate character in some languages)
u+0153 ISOlat2p:before { content:"\0153"; }alert("\u0153");
&Scaron;Š&#352;latin capital letter s with caronu+0160 ISOlat2p:before { content:"\0160"; }alert("\u0160");
&scaron;š&#353;latin small letter s with caronu+0161 ISOlat2p:before { content:"\0161"; }alert("\u0161");
&Yuml;Ÿ&#376;latin capital letter y with diaeresisu+0178 ISOlat2p:before { content:"\0178"; }alert("\u0178");

Latin Extended-B

&fnof;ƒ&#402;latin small f with hook, a.k.a. function, a.k.a. florinu+0192 ISOtechp:before { content:"\0192"; }alert("\u0192");

Spacing Modifier Letters

&circ;ˆmodifier letter circumflex accentu+02C6 ISOpubp:before { content:"\02c6"; }alert("\u02c6");
&tilde;˜small tildeu+02DC ISOdiap:before { content:"\02dc"; }alert("\u02dc");
Greek
&Alpha;Α&#913;greek capital letter alphau+0391p:before { content:"\0391"; }alert("\u0391");
&Beta;Β&#914;greek capital letter betau+0392p:before { content:"\0392"; }alert("\u0392");
&Gamma;Γ&#915;greek capital letter gammau+0393 ISOgrk3p:before { content:"\0393"; }alert("\u0395");
&Delta;Δ&#916;greek capital letter deltau+0394 ISOgrk3p:before { content:"\0394"; }alert("\u0394");
&Epsilon;Ε&#917;greek capital letter epsilonu+0395p:before { content:"\0395"; }alert("\u0395");
&Zeta;Ζ&#918;greek capital letter zetau+0396p:before { content:"\0396"; }alert("\u0396");
&Eta ;Η&#919;greek capital letter etau+0397p:before { content:"\0397"; }alert("\u0397");
&Theta;Θ&#920;greek capital letter thetau+0398 ISOgrk3p:before { content:"\0398"; }alert("\u0398");
&Iota;Ι&#921;greek capital letter iotau+0399p:before { content:"\0399"; }alert("\u0399");
&Kappa;Κ&#922;greek capital letter kappau+039Ap:before { content:"\039a"; }alert("\u039a");
&Lambda;Λ&#923;greek capital letter lambdau+039B ISOgrk3p:before { content:"\039b"; }alert("\u039b");
&Mu ;Μ&#924;greek capital letter muu+039Cp:before { content:"\039c"; }alert("\u039c");
&Nu ;Ν&#925;greek capital letter nuu+039Dp:before { content:"\039d"; }alert("\u039D");
&Xi ;Ξ&#926;greek capital letter xiu+039E ISOgrk3p:before { content:"\039e"; }alert("\u039e");
&Omicron;Ο&#927;greek capital letter omicronu+039Fp:before { content:"\039f"; }alert("\u039f");
&Pi ;Π&#928;greek capital letter piu+03A0 ISOgrk3p:before { content:"\03a0"; }alert("\u03a0");
&Rho ;Ρ&#929;greek capital letter rhou+03A1p:before { content:"\03a1"; }alert("\u03a1");
there is no Sigmaf, and no u+03A2 character either)
&Sigma;Σ&#931;greek capital letter sigmau+03A3 ISOgrk3p:before { content:"\03a3"; }alert("\u03A3");
&Tau ;Τ&#932;greek capital letter tauu+03A4p:before { content:"\03a4"; }alert("\u03A4");
&Upsilon;Υ&#933;greek capital letter upsilonu+03A5 ISOgrk3p:before { content:"\03a5"; }alert("\u03A5");
&Phi ;Φ&#934;greek capital letter phiu+03A6 ISOgrk3p:before { content:"\03a6"; }alert("\u03A6");
&Chi ;Χ&#935;greek capital letter chiu+03A7p:before { content:"\03a7"; }alert("\u03A7");
&Psi ;Ψ&#936;greek capital letter psiu+03A8 ISOgrk3p:before { content:"\03a8"; }alert("\u03A8");
&Omega;Ω&#937;greek capital letter omegau+03A9 ISOgrk3p:before { content:"\03a9"; }alert("\u03A9");
&alpha;α&#945;greek small letter alphau+03B1 ISOgrk3p:before { content:"\03b1"; }alert("\u03b1");
&beta;β&#946;greek small letter betau+03B2 ISOgrk3p:before { content:"\03b2"; }alert("\u03b2");
&gamma;γ&#947;greek small letter gammau+03B3 ISOgrk3p:before { content:"\03b3"; }alert("\u03b3");
&delta;δ&#948;greek small letter deltau+03B4 ISOgrk3p:before { content:"\03b4"; }alert("\u03b4");
&epsilon;ε&#949;greek small letter epsilonu+03B5 ISOgrk3p:before { content:"\03b5"; }alert("\u03b5");
&zeta;ζ&#950;greek small letter zetau+03B6 ISOgrk3p:before { content:"\03b6"; }alert("\u03b6");
&eta ;η&#951;greek small letter etau+03B7 ISOgrk3p:before { content:"\03b7"; }alert("\u03b7");
&theta;θ&#952;greek small letter thetau+03B8 ISOgrk3p:before { content:"\03b8"; }alert("\u03b8");
&iota;ι&#953;greek small letter iotau+03B9 ISOgrk3p:before { content:"\03b9"; }alert("\u03b9");
&kappa;κ&#954;greek small letter kappau+03BA ISOgrk3p:before { content:"\03ba"; }alert("\u03ba");
&lambda;λ&#955;greek small letter lambdau+03BB ISOgrk3p:before { content:"\03bb"; }alert("\u03bb");
&mu ;μ&#956;greek small letter muu+03BC ISOgrk3p:before { content:"\03bc"; }alert("\u03bc");
&nu ;ν&#957;greek small letter nuu+03BD ISOgrk3p:before { content:"\03bd"; }alert("\u03bd");
&xi ;ξ&#958;greek small letter xiu+03BE ISOgrk3p:before { content:"\03be"; }alert("\u03be");
&omicron;ο&#959;greek small letter omicronu+03BF NEWp:before { content:"\03bf"; }alert("\u03bf");
&pi ;π&#960;greek small letter piu+03C0 ISOgrk3p:before { content:"\03c0"; }alert("\u03c0");
&rho ;ρ&#961;greek small letter rhou+03C1 ISOgrk3p:before { content:"\03c1"; }alert("\u03c1");
&sigmaf;ς&#962;greek small letter final sigmau+03C2 ISOgrk3p:before { content:"\03C2"; }alert("\u03c2");
&sigma;σ&#963;greek small letter sigmau+03C3 ISOgrk3p:before { content:"\03C3"; }alert("\u03c3");
&tau ;τ&#964;greek small letter tauu+03C4 ISOgrk3p:before { content:"\03C4"; }alert("\u03c4");
&upsilon;υ&#965;greek small letter upsilonu+03C5 ISOgrk3p:before { content:"\03C5"; }alert("\u03c5");
&phi ;φ&#966;greek small letter phiu+03C6 ISOgrk3p:before { content:"\03C6"; }alert("\03c6");
&chi ;χ&#967;greek small letter chiu+03C7 ISOgrk3p:before { content:"\03C7"; }alert("\u03c7");
&psi ;ψ&#968;greek small letter psiu+03C8 ISOgrk3p:before { content:"\03C8"; }alert("\u03c8");
&omega;ω&#969;greek small letter omegau+03C9 ISOgrk3p:before { content:"\03C9"; }alert("\u03c9");
&thetasym;ϑ&#977;greek small letter theta symbolu+03D1 NEWp:before { content:"\03D1"; }alert("\u03D1");
&upsih;ϒ&#978;greek upsilon with hook symbolu+03D2 NEWp:before { content:"\03D2"; }alert("\u03D2");
&piv ;ϖ&#982;greek pi symbolu+03D6 ISOgrk3p:before { content:"\03D6"; }alert("\u03D6");

Punctuation

&ensp;&#8194;en spaceu+2002 ISOpubp:before { content:"\2002";}alert("\u2002");
&emsp;&#8195;em spaceu+2003 ISOpubp:before { content:"\2003";}alert("\u2003");
&thinsp;&#8201;thin spaceu+2009 ISOpubp:before { content:"\2009";}alert("\u2009");
&zwnj;&#8204;zero width non-joineru+200C NEW RFC 2070p:before { content:"\200C";}alert("\u200C");
&zwj;&#8205;zero width joineru+200D NEW RFC 2070p:before { content:"\200D";}alert("\u200d");
&lrm;&#8206;left-to-right marku+200E NEW RFC 2070p:before { content:"\200E";}alert("\u200e");
&rlm;&#8207;right-to-left marku+200F NEW RFC 2070p:before { content:"\200F";}alert("\u200f");
&ndash;&#8211;en dashu+2013 ISOpubp:before { content:"\2013";}alert("\u2013");
&mdash;&#8212;em dashu+2014 ISOpubp:before { content:"\2014";}alert("\u2014");
&lsquo;&#8216;left single quotation marku+2018 ISOnump:before { content:"\2018";}alert("\u2018");
&rsquo;&#8217;right single quotation marku+2019 ISOnump:before { content:"\2019";}alert("\u2019");
&sbquo;&#8218;single low-9 quotation marku+201A NEWp:before { content:"\201A";}alert("\u201a");
&ldquo;&#8220;left double quotation marku+201C ISOnump:before { content:"\201C";}alert("\u201c");
&rdquo;&#8221;right double quotation marku+201D ISOnump:before { content:"\201D";}alert("\u201d");
&bdquo;&#8222;double low-9 quotation marku+201E NEWp:before { content:"\201E";}alert("\u201e");
&dagger;&#8224;daggeru+2020 ISOpubp:before { content:"\2020";}alert("\u2020");
&Dagger;&#8225;double daggeru+2021 ISOpubp:before { content:"\2021";}alert("\u2021");
&permil;&#8240;per mille signu+2030 ISOtechp:before { content:"\2030";}alert("\u2030");
&lsaquo;&#8249;single left-pointing angle quotation mark
(lsaquo is proposed but not yet ISO standardised)
u+2039 ISO proposedp:before { content:"\2039";}alert("\u2039");
&rsaquo;&#8250;single right-pointing angle quotation mark
rsaquo is proposed but not yet ISO standardised
u+203A ISO proposedp:before { content:"\203A";}alert("\u203a");

General Punctuation

&bull;&#8226;bullet, a.k.a. black small circle
bullet is NOT the same as bullet operator — u+2219
u+2022 ISOpubalert("\u2219");
&hellip;&#8230;horizontal ellipsis, a.k.a. three dot leaderu+2026 ISOpubalert("\u2026");
&prime;&#8242;prime, a.k.a. minutes, a.k.a. feetu+2032 ISOtechalert("\u2032");
&Prime;&#8243;double prime, a.k.a. seconds, a.k.a. inchesu+2033 ISOtechalert("\u2033");
&oline;&#8254;overline, a.k.a. spacing overscoreu+203E NEWalert("\u203e");
&frasl;&#8260;fraction slashu+2044 NEWalert("\u8260");

Letterlike Symbols

&weierp;&#8472;script capital P, a.k.a. power set, a.k.a. Weierstrass pu+2118 ISOamsoalert("\u2118");
&image;&#8465;blackletter capital I, a.k.a. imaginary partu+2111 ISOamsoalert("\u2111");
&real;&#8476;blackletter capital R, a.k.a. real part symbolu+211C ISOamsoalert("\u211c");
&trade;&#8482;trade mark signu+2122 ISOnumalert("\u2122");
&alefsym;&#8501;alef symbol, a.k.a. first transfinite cardinal
alef symbol is NOT the same as hebrew letter alef — u+05D0 although the same glyph
could be used to depict both characters
u+2135 NEWalert("\u");

Arrows

&larr;&#8592;leftwards arrowu+2190 ISOnumalert("\u2190");
&uarr;&#8593;upwards arrowu+2191 ISOnumalert("\u2191");
&rarr;&#8594;rightwards arrowu+2192 ISOnumalert("\u2192");
&darr;&#8595;downwards arrowu+2193 ISOnumalert("\u2193");
&harr;&#8596;left right arrowu+2194 ISOamsaalert("\u2194");
&crarr;&#8629;downwards arrow with corner leftwards, a.k.a. carriage returnu+21B5 NEWalert("\u21b5");
&lArr;&#8656;leftwards double arrow
can be used for ‘is implied by’
u+21D0 ISOtechalert("\u21d0");
&uArr;&#8657;upwards double arrowu+21D1 ISOamsaalert("\u21d1");
&rArr;&#8658;rightwards double arrowu+21D2 ISOtechalert("\u21d2");
&dArr;&#8659;downwards double arrowu+21D3 ISOamsaalert("\ud1d3");
&hArr;&#8660;left right double arrowu+21D4 ISOamsaalert("\u21d4");

Mathematical Operators

&forall;&#8704;for allu+2200 ISOtechalert("\u2200");
&part;&#8706;partial differentialu+2202 ISOtechalert("\u2202");
&exist;&#8707;there existsu+2203 ISOtechalert("\u2203");
&empty;&#8709;empty set, a.k.a. null set, a.k.a. diameteru+2205 ISOamsoalert("\u2205");
&nabla;&#8711;nabla, a.k.a. backward differenceu+2207 ISOtechalert("\u2207");
&isin;&#8712;element ofu+2208 ISOtechalert("\u2208");
&notin;&#8713;not an element ofu+2209 ISOtechalert("\u2209");
&ni ;&#8715;contains as memberu+220B ISOtechalert("\u220b");
&prod;&#8719;n-ary product, a.k.a. product sign
prod is NOT the same character as u+03A0 ‘greek capital letter pi’ though the same
glyph might be used for both
u+220F ISOamsbalert("\u03a0");
&sum ;&#8721;n-ary sumation
sum is NOT the same character as u+03A3 ‘greek capital letter sigma’ though the same
glyph might be used for both
u+2211 ISOamsbalert("\u03a3");
&minus;&#8722;minus signu+2212 ISOtechalert("\u2212");
&lowast;&#8727;asterisk operatoru+2217 ISOtechalert("\u2217");
&radic;&#8730;square root, a.k.a. radical signu+221A ISOtechalert("\u221a");
&prop;&#8733;proportional tou+221D ISOtechalert("\u221d");
&infin;&#8734;infinityu+221E ISOtechalert("\u221e");
&ang ;&#8736;angleu+2220 ISOamsoalert("\u2220");
&and ;&#8869;logical and, a.k.a. wedgeu+2227 ISOtechalert("\u2227");
&or ;&#8870;logical or, a.k.a. veeu+2228 ISOtechalert("\u2228");
&cap ;&#8745;intersection, a.k.a. capu+2229 ISOtechalert("\u2229");
&cup ;&#8746;union, a.k.a. cupu+222A ISOtechalert("\u222a");
&int ;&#8747;integralu+222B ISOtechalert("\u222b");
&there4;&#8756;thereforeu+2234 ISOtechalert("\u2234");
&sim ;&#8764;tilde operator, a.k.a. varies with,
similar to tilde operator, but is NOT the same character as the tilde u+007E,
although the same glyph might be used to represent both
u+223C ISOtechalert("\u223c");
&cong;&#8773;approximately equal tou+2245 ISOtechalert("\u2245");
&asymp;&#8776;almost equal to, a.k.a. asymptotic tou+2248 ISOamsralert("\u2248");
&ne ;&#8800;not equal tou+2260 ISOtechalert("\u2260");
&equiv;&#8801;identical tou+2261 ISOtechalert("\u2261");
&le ;&#8804;less-than or equal tou+2264 ISOtechalert("\u2264");
&ge ;&#8805;greater-than or equal tou+2265 ISOtechalert("\u2265");
&sub ;&#8834;subset ofu+2282 ISOtechalert("\u2282");
&sup ;&#8835;superset of
note that nsup, ‘not a superset of u+2283′ is not covered by the Symbol font
encoding and is not included.
u+2283 ISOtechalert("\u2283");
&nsub;&#8836;not a subset ofu+2284 ISOamsnalert("\u2284");
&sube;&#8838;subset of or equal tou+2286 ISOtechalert("\u2286");
&supe;&#8839;superset of or equal tou+2287 ISOtechalert("\u2287");
&oplus;&#8853;circled plus, a.k.a. direct sumu+2295 ISOamsbalert("\u2295");
&otimes;&#8855;circled times, a.k.a. vector productu+2297 ISOamsbalert("\u2297");
&perp;&#8869;up tack, a.k.a. orthogonal to, a.k.a. perpendicularu+22A5 ISOtechalert("\u22a5");
&sdot;&#8901;dot operator
dot operator is NOT the same character as u+00B7 middle dot
u+22C5 ISOamsbalert("\u22c5");

Miscellaneous Technical

&lceil;&#8968;left ceiling, a.k.a. apl upstileu+2308, ISOamscalert("\u2308");
&rceil;&#8969;right ceilingu+2309, ISOamscalert("\u2309");
&lfloor;&#8970;left floor, a.k.a. apl downstileu+230A, ISOamscalert("\u230a");
&rfloor;&#8971;right flooru+230B, ISOamscalert("\u230b");
&lang;&#9001;left-pointing angle bracket, a.k.a. bra
lang is NOT the same character as u+003C ‘less than’
or u+2039 ’single left-pointing angle quotation mark’
u+2329 ISOtechalert("\u2329");
&rang;&#9002;right-pointing angle bracket, a.k.a. ket
rang is NOT the same character as u+003E ‘greater than’
or u+203A ’single right-pointing angle quotation mark’
u+232A ISOtechalert("\u232a");

Geometric Shapes

&loz ;&#9674;lozengeu+25CA ISOpubalert("\u25ca");

Miscellaneous Symbols

&spades;&#9824;black spade suitu+2660 ISOpubalert("\u2660");
&clubs;&#9827;black club suit, a.k.a. shamrocku+2663 ISOpubalert("\u2663");
&hearts;&#9829;black heart suit, a.k.a. valentineu+2665 ISOpubalert("\u2665");
&diams;&#9830;black diamond suitu+2666 ISOpubalert("\u2666");

Turn Off Autocomplete for Input

Just use the autocomplete attribute:

<input name="q" type="text" autocomplete="off"/>

This would be useful when a text input is one-off and unique. Like a CAPTCHA input, one-time use codes, or for when you have built your own auto-suggest/auto-complete feature and need to turn off the browser default.

Cufon 101

1. Include the JavaScript for Cufón and the Cufón font

<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/TitilliumMaps.font.js"></script>

2. HTML

Normal tags

<h1>Business Solutions</h1>
<h2>Business Insurance</h2>

3. Tell Cufón to replace the fonts for the specified CSS selectors

<script type="text/javascript"> Cufon.replace('h1, h2', { fontFamily: 'TitilliumMaps26L', hover: true });
</script>

4. Add JavaScript error handling in case there is an error loading

function handleError() { return true; }
window.onerror = handleError;

5. CSS

The font color, size and hover color is controlled via the CSS classes associated with the HTML element.

h1 { font-size: 50px; color: red;
}

Cross Domain GET Forwarding

When you do an AJAX request on a website, the URL you request from needs to reside on the same domain as where the request was made from. This is a security restriction imposed by the browser. There is a way to sneak around this by using a bit of a "man in the middle" approach.

PHP, being a server-side language, has the ability to pull content from any URL. So a PHP file can become the man in the middle. The contents of the PHP file can be set up to accept a URL as a parameter and then return the contents of that URL.

<?php echo file_get_contents($_GET['url']); // WARNING: You REALLY should write something to whitelist or otherwise limit what the function will accept, or it could be a security danger to your server (people could read any file). ?>

With that in place, we can do an AJAX request directly to that URL, passing it the URL we actually want the data from as a parameter. See how we are passing "http://google.com" as data below.

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js?ver=1.3.2'></script>
<script type='text/javascript'> $(function() { $.ajax({ type: "GET", dataType: 'html', data: 'url=http://google.com', url: 'get.php', success: function(data){ // Yah! Do something cool with data }, error: function(){ // Boo! Handle the error. } }); });
</script>

This is an extremely simple example. If you are interested in a more robust version, check out the Simple PHP Proxy.

iPad Detection

Of course, the iPad is a pretty large screen and a fully capable browser, so most websites don't need to have iPad specific versions of them. But if you need to, you can detect for it with .htaccess

RewriteCond %{HTTP_USER_AGENT} ^.*iPad.*$
RewriteRule ^(.*)$ http://ipad.yourdomain.com [R=301]

This will redirect iPad users to a URL you specify. This is probably the best way to do it (assuming you are running an Apache server), but if you aren't, there are PHP and JavaScript methods here.

Random Hex Color

Technique #1

<?php $rand = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); $color = '#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)]; ?>

Then echo out the $color value anywhere you need it. For example:

<body style="background: <?php echo $color; ?>;">

Technique #2

<?php printf( "#%06X\n", mt_rand( 0, 0xFFFFFF )); ?>

There is also a JavaScript version.

Force Correct content-type for XHTML Documents

Most webservers serve XHTML content as text/html what is definitly the right way to handle XHTML documents. In case the server isn't doing that correctly, you can force it on Apache servers with .htaccess:

RewriteEngine On
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0
RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{THE_REQUEST} HTTP/1\.1
RewriteRule .* - "[T=application/xhtml+xml; charset=ISO-8859-1]"

Set Expires

Setting "expires" tells browsers downloading these files that they don't need to request it again for this specific length of time. In otherwords, use the cache instead if you have it. This can reduce stress on the server for you, and speed up page load time for visitors.

# BEGIN EXPIRES
<IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 10 days" ExpiresByType text/css "access plus 1 week" ExpiresByType text/plain "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" ExpiresByType application/javascript "access plus 1 week" ExpiresByType application/x-icon "access plus 1 year"
</IfModule>
# END EXPIRES