php
Find values recursively inside complex json objects in PHP
A PHP function to to quickly search complex, nested php structures for specific values.
Test page for Bright Links plugin
To test the plugin hover your mouse to a link, or tap the link on mobile device.
Highlight text for search results in PHP
Useful code to highlight text occurences in search results or in a text. How to highlight text in a string…
How to add rel=”nofollow” to links with preg_replace()
Adding rel="nofollow" to external link is a good SEO practice.
Limit the number of categories for posts in WordPress
CHOOSE ONLY ONE CATEGORY WORDPRESS If you need to limit the number of categories used by the authors of your…
Reordering rows records on a mysql table with PHP
This PHP function lets you reorder records on a table when you have a field used for save the position.…
Scraping content with PHP as if it was jQuery
Building a spider or a bot needs some knowledge of regular expressions, you must know and use preg_match or preg_match_all…
Embedding images in HTML or CSS with PHP
This small function returns an encoded string to embed images, inline, inside your html/css code and reduce the number of…
Block junk emails, spammers and temporary emails
If you need an Email Validator Function, consider this version that includes also the check against common temporary mail services…
Get instagram data without official api in PHP
Instagram has an official API to interact with its database of images and users. If you have enough time to…
Push notifications from php to Android devices with Minibots Class
More than two years ago I wrote a post about sending push notifications from php to an iOS app called…
Make a cron job with IFTTT
Cron is a software utility, a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain…
User agent detect with PHP
Small PHP code snippet to make a quick detect if the browser that requests your page is on a mobile…
How many times a web link has been shared on Twitter
Twitter share button and Facebook share button are the most used buttons to share links on Internet. You can read…
Updated version of the the Facebook Connect Tutorial
I’ve written un updated version of the Facebook Connect Tutorial, you can find it in the top menu of Barattalo.it.…
How to read facebook likes count from PHP
When you add facebook like button to your site, probably, you also want to save the number of likes of…
Mini log functions for PHP
When you have to log something with php you can use fopen to create a file and then use fwrite…
PHP code to check if remote mp3 exists
Hi, I’ve a big table with thousands of mp3 links. Sice these links come from an old database, many of…
How to use Instagr.am photos on your site
UPDATE: 2013-12-04 I’ve made a method in the Mini Bots PHP Class that lets you retrieve images from instagram without…
get MySpace events with a PHP function
Here is a function to read the concerts for a myspace band page. This code retrieves the “shows page” for…
PHP Geocoding function, from address to coordinates lat long
This is a small function included in the Minibots Class that converts an address to a couple of coordinates Latitude,…
ASP equivalent to PHP strip_tags
I’ve found those functions around in the internet and I put them here just to remind how to strip tags…
Copying remote files on your server with PHP
UPDATE: This function has been inserted in the Mini Bots PHP Class Here is a function that let you copy…
ASP equivalent to PHP Ucfirst function
This code does the same thing that Ucfirst function makes in PHP. “Ucfirst” means “Uppercase first letter”. ASP doesn’t have…
ASP equivalent to PHP ereg_replace function
I’ve used so many time the php function ereg_replace that when I have to use ASP (‘cause sometimens you have…