For this WordPress blog, I was looking for a quick PHP snippet on the web to make first paragraph bold, or increase its font size in post contents, like they have in Smashing Magazine website. I found few examples but not everything is clear. I didn’t want to use CSS :first-child Selector, because it won’t work with older browsers.
Implementing “Login with Facebook” using just their new PHP SDK is very easy, everything can be accomplished with minimal PHP code, but some of us may want to take it little further to create a nice looking Ajax based login system. Yes, with little bit of Javascript and Facebook PHP SDK, we can create Ajax based Facebook Login system.
Sometimes photos are wrongly taken, eg: upside down, sideways etc, and most newbie users don’t know how to rotate image, so they might just upload image “as it is”. This might cause the problem later, unless you have some kind of image rotate program to set it right.
It’s a really easy function to that copies remote picture into local folder. You can just use PHP copy() directly, but this function does little more than that, enjoy.function grab_remote_pic($new_file_name, $local_dir_path, $remote_picture_url) { if(!is_dir($local_dir_path)){ //create new dir if doesn't exist mkdir($local_dir_path); } $local_file_path = $local_dir_path .'/'.$new_file_name; if(copy($remote_picture_url, $local_file_path)) { return true; } } Usage ://grab_remote_pic(NEW FILE NAME, LOCAL SAVE PATH, REMOTE IMAGE URL) grab_remote_pic('new_file_name.gif', 'home/path/to/local/images/', 'http://graph.facebook.com/1442161041/picture?width=120&height=120');