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

How to export an ASP Associative Array to XML

“Asp Associative Array Class” provides a method to easly export all items to a well formatted XML string. For example, You can create a new *.ASP file : [sourcecode language=”vb”] <!–#include file="AssociativeArrayClass.asp" –> <% Dim Person, God Set Person = … Read More

How to populate an ASP Associative Array with records from MySQL / Access database Table

In this example, You can learn how to populate an ASP Associative Array with the records of a database table (MS Access or MySQL); then, how to programmatically manage well structured data without any extra SQL. Before to start: For … Read More

How to use Associative Arrays in ASP

First of all, You need to download the “Asp Associative Array class” then include the file “AssociativeArrayClass.asp” in your asp page. Right now, You can start declaring associative arrays in ASP with the following syntax: [sourcecode language=”vb”] Dim Person Set … Read More

VBScript Class to create easly Associative Arrays in ASP like in PHP

I’ve posted a project at Source Forge with an ASP/VBScript class to create easly associative arrays like in PHP; visit http://sourceforge.net/projects/asp-assoc-array/ It is possible also load in an associative-array the data coming from MySQL or MS Access databases, then You … 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

Easy-to-use and strong Encrypt/Decrypt PHP functions

posted in: Cryptography, PHP, Programming 1

I wrote those two following PHP functions to encrypt and decrypt strings easly and with a stronger encryption module than the other examples on the net (please, note that “strong” does not equals “secure”!); Happy encryption/decryption! 🙂 Max [sourcecode language=”php”] … Read More

Javascript isArray() function

posted in: Javascript, Programming 0

Javascript does not provide a function to recognize if a variable is an array or not; you can make a “typeof” of the variable however u’ll get an ‘object’ datatype, as in the following code [sourcecode language=”javascript”] var myarray = … 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

1 2