Архив

Публикации с меткой ‘php’

php print page break

22 Апрель 2009 Нет комментариев

Use this code for php print page break in word document.

<br style=»page-break-before:always» />

Список IP адресов серверов, с которых производились рассылки СПАМа

4 Февраль 2009 Нет комментариев

DNSBL — это динамически обновляющийся список IP адресов серверов, с помощью которых производились рассылки СПАМа.

Читать далее…

Categories: Компьютеры Tags: , ,

PHP function for make JSON

PHP function for make JSON from array

Читать далее…

Getting real IP address in PHP

17 Июль 2008 1 комментарий

Are you using $_SERVER['REMOTE_ADDR'] to find the the client’s IP address in PHP? Well dude, you might be amazed to know that it may not return the true IP address of the client at all time. If your client is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP just returns the the IP address of the proxy server not of the client’s machine.  So here is a simple function in PHP to find the real IP address of the client’s machine. Читать далее…

Categories: Компьютеры Tags:

foreach in JavaScript

Actually that’s not true at all.
As all javascript objects are really just associative arrays, there is a foreach like syntax for the ‘for’ construct.
Without it it would be very hard to work with many common javascript objects.
It’s actually very simple to use and incredibly useful if you like associative arrays.

You just have to make sure to use it on an associative array and not an object.
Example below

Читать далее…

Convert a Webpage to Plain Text

This function takes a URL and returns a plain-text version of the page. It uses cURL to retrieve the page and a combination of regular expressions to strip all unwanted whitespace. This function will even strip the text from STYLE and SCRIPT tags, which are ignored by PHP functions such as strip_tags (they strip only the tags, leaving the text in the middle intact).

Regular expressions were split in 2 stages, to avoid deleting single carriage returns (also matched by \s) but still delete all blank lines and multiple linefeeds or spaces, trimming operations took place in 2 stages. Читать далее…

Categories: Новости Tags:

PHP5 OOP

Object oriented & design patterns – php5 [hebrew]
Overview about object-oriented programming, using objects in php5 and design patterns examples for php5. [for php-israel community]

MVC example:

http://www.denover.com/uploads/mvc-sample.tar.gz

Categories: Новости Tags: