PHP

PHP tinyurl

In: PHP

30 Jun 2010

Use PHP tinyurl to get shorten URL by tinyurl service. This short snippet will show you how to make function to get PHP tinyurl: 1 2 3 function get_tinyurl($url) { return file_get_contents("http://tinyurl.com/api-create.php?url=" . $url); }

PHP publish Facebook

In: PHP

30 Jun 2010

If you want to use PHP to publish on Facebook you can use following php function: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 [...]

PHP find image

In: PHP

29 Jun 2010

If you want to use PHP to find image in your HTML, you can use following PHP script: 1 2 3 $htmlCode = ‘Some HTML with image <img src="/demo.jpg">’; preg_match("#<img(.*)src=(.*)>#i", $htmlCode, $match); echo $match[0];

Zend URL

In: PHP

29 Jun 2010

To build URL with Zend Framework, you should use: echo $this->url(array $urlOptions = array(), $name = null, $reset = false, $encode = true); so, in order to use Zend URL, use following: echo $this->url(array(’module’ => ‘moduleName’, ‘controller’ => ‘controllerName’, ‘action’ => ‘actionName’), null, true);