How to parse and process HTML/XML in PHP

Simple HTML DOM is a great open-source parser: simplehtmldom.sourceforge It treats DOM elements in an object-oriented way, and the new iteration has a lot of coverage for non-compliant code. There are also some great functions like you’d see in JavaScript, … Read More

Convert a DateTime string to a Unix timestamp in VbScript / Classic ASP

To convert a datetime string value like “YYYY-MM-DD HH:MM:SS” to a Unix timestamp (the seconds from 01/01/1970 to the input datetime) You can use a conversion function as the following: Then, to get back the datetime from the Unix timestamp … Read More

PHP Date or Datetime to MySQL Datetime and viceversa

Two useful PHP functions to convert normal date/datetime (“25.12.2010 12:10:00” or “25.12.2010”) to MySQL datetime (like “2010-12-25 12:10:00” or “2010-12-25 00:00:00″); You can get back a date/datetime from MySQL datetime too: [sourcecode language=”php”] function datetime2mysqldatetime($datetime){ // ‘25.12.2010 12:10:00’ -> ‘2010-12-25 … Read More

How to stringify an object in Javascript: converting an object to a padded & well-formatted string or simply inline

I wrote a function to convert an object in a string (stringification) without using a JSON library; you can convert an object to a well formatted string with padding or simply to an unique line: [sourcecode language=”javascript”] function stringify(object, padding, … Read More

How to remove accent marks and german umlauts from URLs and Strings in .NET

I wrote two functions in .NET to remove easly any accent and umlaut marks from a string and to get the equivalent non-accented string, this is very useful to normalize URLs; for example, with the StripAccentMarks() method, from “àbcdèéfghìlmnòpqrstùvzäöüÄÖÜ” u’ll … Read More

How to implement IsNumeric() VB.NET function in C#

This article describes how to implement the useful “IsNumeric” function in Microsoft Visual Basic .NET in Visual C#. The IsNumeric() function returns a Boolean value indicating whether an expression can be evaluated as a number. The IsNumeric() function returns True … Read More

How to extract text content from tags in VB.Net

With this simple vb.net function You are able to extract content from HTML tags, useful and smart Max 🙂 [sourcecode language=”vb”] Public Function GetTagContent(ByRef html As String, ByVal start_tag As String, ByVal end_tag As String) As String Dim s As … Read More