Saturday, 28 December 2013

Split string into array using regular expression in PHP

Today, i came across a handy PHP function which will convert the string in to array based on regular expression. i.e preg_split().

Implementation:
$test = "Hi, my blog name sureshdotariya";

$result = preg_split('/[\s,]+/',$test,-1,PREG_SPLIT_NO_EMPTY);

Wednesday, 25 December 2013

Implement Flash Messages using Session in PHP - Part1

As part of the post series, today we are going to see how we can implement Flash Messages using PHP Session. Before proceeding into that, first i  like to explain what is Flash Message and its usage.

What is Flash Message

Flash message is a message that will be shown/displayed only once. if you reload the browser or navigated to other pages and came back, you won't see the same message displayed again.

Sunday, 22 December 2013

How to get MIME type for the file in PHP

Today, we are going to see how to get MIME Type for the file in PHP.  In order to get the MIME Type we will use mime_content_type() methods, but this method has been deprecated. so instead we are going to use Fileinfo. Let's see the implementation.

Saturday, 21 December 2013

How to get the file extension and other information about file path in PHP

Today, we are going to see how to get the file extension and other information about file path in PHP. In order to get file extension from file path, PHP developers usually use strpos() to get the position of '.' and then by using substr() with dot position to get the file extension.

You can also use the below approach to get the file extension with minimal code.

Wednesday, 18 December 2013

Packt’s $5 eBook Bonanza is back!

Following on from the success of last year’s festive offer, the publisher will be celebrating the holiday season with an even bigger $5 Bonanza.

From December 19th, customers will be able to get any eBook or Video from Packt for just $5. This sale covers every title in the 1700+ range and customers can grab as many as they like until January 3rd 2014 – more information is available at http://bit.ly/1jdCr2W.

Saturday, 7 December 2013

Sencha Touch 2: How to automatically pre-populate form values in Tab Panel Component

As requested by one of my reader, today we are going to see how to automatically pre-populate form element values from one Tab to another Tab in Tab Panel component. If you are still not sure, please refer to the below Tab Panel snapshot images.

Sunday, 1 December 2013

Win A Free Copy of Packt's ‘Mobile Security: how to Secure, Privatize, and Recover Your Device’ !

We are pleased to announce that we are organizing a giveaway especially for you. All you need to do is just comment below the post and win a free copy of ‘Mobile Security: how to Secure, Privatize, and Recover Your Device’. Three lucky winners stand a chance to win copy of the book. Keep reading to find out how you can be one of the Lucky One.

Packt celebrates Thanksgiving with a week of bespoke special offers

Thanks…for the means we have of acquiring and diffusing useful knowledge.’ George Washington said this as part of the very first Thanksgiving presidential proclamation back in 1789 – and today in 2013, Packt recognizes its mission to IT professionals in those words. So to celebrate this Thanksgiving, from November 28th across a wide range of technology areas.

These offers will include up to 68% off carefully selected bundles of eBooks, savings of over $100 on a set of video courses, as well as deep discounts on Packt’s latest and bestselling titles – covering the latest in Web Development, Big Data, Games Development, and much more.

The whole range of offers will be available to explore at www.packtpub.com until December 6th.
Related Posts Plugin for WordPress, Blogger...