Tag Archives | snippet

Flash detect by Javascript

How to detect flash by Javascript

Read full story Comments { 0 }

PHP: Auto detect hosting support IPv6

How to determine hosting support IPv6

Read full story Comments { 0 }
PHP: How to get size of a remote file – Part 2

PHP: How to get size of a remote file – Part 2

Part 1: PHP: How to get size of a remote file With a local file, we can get file size of it by using filesize, but with a remote file, how to get size of a remote file? We offer some methods to get size of a remote file. Method 7: Note: after use curl_getinfo, […]

Read full story Comments { 1 }
PHP: How to get size of a remote file

PHP: How to get size of a remote file

With a local file, we can get file size of it by using filesize, but with a remote file, how to get size of a remote file? We offer some methods to get size of a remote file Method 1: use CURL Example 1: Result: Example 2: Result: Method 2: Method 3: use fsockopen Method […]

Read full story Comments { 1 }

PHP function: mb_ucwords – Uppercase the first character of each word in a string

Currently on PHP does not have a multibyte (UTF-8) version of ucwords function. I wrote some multibyte mb_ucwords function: You must call these functions before: Method 1: Method 2: Example: Result:

Read full story Comments { 0 }

PHP: Simple script to detect Germany ip address

PHP: Simple script to detect Germany ip address Example 1: Result: Example 2: Result: Note: image copyright: blog.gostorm.net

Read full story Comments { 0 }

PHP: convert binary to text string

The PHP’s core offers some function to convert data between binary, decimal, hexadecimal and etc. But how to convert from binary to text, we offer some function to do that. Method 1: using functions pack and base_convert Example: But with the long binary data, we can’t convert Because of the function base_convert can’t work with […]

Read full story Comments { 0 }

PHP: convert string to binary

Tool online: Convert string to binary online The PHP’s core offers some function to convert data between binary, decimal, hexadecimal and etc. But how to convert from binary string to binary, we offer some function to do that. Method 1: using functions unpack and base_convert Example: but with the long string, we can’t convert Because […]

Read full story Comments { 1 }

PHP: ActionScript Array.slice method

In ActionScript, to slice an array, we use Array.slice method: Returns a new array that consists of a range of elements from the original array, without modifying the original array. The returned array includes the startIndex element and all elements up to, but not including, the endIndex element. Now, we make the similar method in […]

Read full story Comments { 0 }
PHP function to parse BMP header

PHP function to parse BMP header

Read first: BMP file structure analysis by PHP Example 1: 5-5-5 16-bit Result: Example 2: 5-6-5 16-bit Result: Example 3: 4-4-4 16-bit Result:

Read full story Comments { 1 }