Code Snippets

Code Snippets

Code Snippets

Snippet is a programming term for a small region of re-usable source code, machine code or text. Ordinarily, these are formally-defined operative units to incorporate into larger programming modules. Snippets are often used to clarify the meaning of an otherwise "cluttered" function, or to minimize the use of repeated code that is common to other functions.

The purpose of this archive is to share code snippets, scripts, and functions with the Open Source Software Community.

Whats new in C# Code Snippets

C#

C#

Whats new in C++/CLI Code Snippets

C++/CLI

C++/CLI

Whats new in PHP Code Snippets

PHP

  • Validate IPv4, IPv6 IP Addresses. These PHP Code snippets show how to validate IPv4 or IPv6 IP addresses. Also it allows checking IP address belongs to private network address spaces.
  • PHP Code Snippet - Check Email Headers. PHP code snippet to check email headers in a string. NoEmailHeaders function checks given string. Function return TRUE if there are no email headers in given string, if not function will return FALSE.
  • PHP Code Snippet - Check for new line characters. PHP code snippet to check new lines in a string. NoNewLines function checks given string. Function return TRUE if there are no new line characters in given string, if not function will return FALSE.

PHP

  • PHP Code Snippet - Validate Email Address. PHP code snippet to validate given email address. IsValidEmail function validate email address. Function return TRUE if valid email address found, if not function will return FALSE.
  • PHP Code Snippet - Write data to text file. PHP code snippet to write text data into a file using file_put_contents function. Write2TxtFile function writes text data to a given file. Function return TRUE if data successfully written to file, if not function will return FALSE.

Whats new in VB Code Snippets

VB

VB