Category Archive for: php

PHP Code snippets

  • November 22, 2015
  • cboursinos
  • php, Tips
  • Comments Off on PHP Code snippets

Hello everyone, i have some small PHP code snippets that you may want to have. Palindrome $string = str_replace( ‘ ‘, ”, $str ); $a = strtolower(preg_replace(“/[^A-Za-z0-9]/”,””,$string)); return $a==strrev($a); Anagrams return(count_chars($a, 1)==count_chars($b, 1)); Fibbonaci return round(pow((sqrt(5)+1)/2, $n) / sqrt(5));

How to Resize images in php

  • November 10, 2015
  • cboursinos
  • php
  • Comments Off on How to Resize images in php

Many websites need to upload images and manipulated them to fit inside they boxes. An easy way to resize images in PHP is the following code, that create images taking as parameter the file name and the width that you want to give to the new image. First of all you need to install php5-gd…

How to use twitter for sending notifications with Codeigniter

Today i will show you how you can create an application in codeigniter so you can use it to share “notifications” in twitter. First of all you have to create a new application in twitter “Twitter app”. A very helpfull tutorial i founded here Tutorial. If it asks you for your mobile phone, just download…

Codeigniter facebook send notification

Hello when i was trying to find how to send a notification to a user from a facebook app i found many solutions but it was difficult to figure what was going on. So at the end i found the solution. First you need a facebook application, or with javascript sdk or with php sdk.…