Different PHP Loops

Hey Folks,

Now its time to get aware with different php loops in php. Followin is the information about do..while loop, while loop, for loop and foreach.

Basic Loop Concept

You may think how loop is useful and why it is needed ? Here is simple way of explanation. If you want to add 10 numbers, you can do it using arithmetic operator and variables.
<?php
$total = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10;
?>

Now if you want to add 100 numbers, 1000 numbers and even more. Will you write such a long … Continue Reading

Kothimbir Vadi

Kothimbir Vadi (Maharastrian Snacks)
Here is the full recipe for Kothimbir Vadi.

 

Kothimbir Vadi

Kothimbir Vadi

 
Ingredients:
 

Ingredients Name
Qty
Unit

Cumin Powder (Jeera Powder)
1/2
Teaspoon

Asafoetida (Hing)
1
Pinch

Ginger Crushed
1/2
Teaspoon

Garlic Crushed
1/2
Teaspoon

Ajwain
1
pinch

Cumin Seeds
1/2
Teaspoon

Mustard Seeds
 1/2
 Teaspoon

Oil
 3
 Tablespoon

Water as needed

Gram Flour
 1
 Cup

Garam Masala
 1/2
 Teaspoon

Green Chilles
2-3

Coriander Leaves chopped
 1
Bunch

Roasted Peanuts Powder
 1
 Tablespoon

Salt (according to taste)

Oil for deep frying

 
Direction:

Make a batter of Gram flour adding little water. The batter should be thick of pouring consistency.
In a Pan heat little oil for tempering, add mustard seeds, cumin seeds ajwain, ( don’t brown them) After add crushed garlic, ut a ginger, crushed greeen chilles, asafoetida (hing), jeera powder, garam masala & … Continue Reading

Moong Dal Halwa

Moong Dal Halwa
Here is the full recipe for Moong Dal Halwa.

 

Moong Dal Halwa

Moong Dal Halwa

 
Ingredients:
 

Ingredients Name
Qty
Unit

Yellow Moong Dal (Soak overnight)
1
Cup

Ghee
1
Cup

Sugar
1 1/2
Cup

Cardamom Powder
1
Teaspoon

Grated Khoya
1/4
Cup

Dry Fruits (Cashew nuts, Raisins)
1/4
Cup

Hot Water … Continue Reading

Zafrani Pulao

Zafrani Pulao
 

Here is the full recipe for Zafrani Pulao.

Zafrani Pulao

Zafrani Pulao

 
Ingredients:
 

Ingredients Name
Qty
Unit

Oil
2-3
Tablespoon

Rice (Long Grained)
200
gm

Bay Leaves
2-3

Mint Leaves
1/2
bunch

Coriander Leaves
1/2
bunch

Ginger Garlic Paste
1
Tablespoon

Onion
1

Yogurt
1/2
Cup

Cashew Nuts
10
Pcs

Butter
4
Tablespoon

Saffron
1
Pinch

Salt (according to taste)

Fried Onion and … Continue Reading

PHP MySql fetch_assoc Vs fetch_array Vs fetch_object performance difference

In this post we will see how these 3 main MySql data fetching methods in PHP performance.

In almost all php-mysql programming, you will need to fetch data from database to populate your applications with data.

There are 3 most popular methods of getting more than one data set when fetched.

mysql_fetch_assoc() : This function fetch an associative array of data.
mysql_fetch_array() : This function returns a combination array of associative elements as well as data with numerical index.
mysql_fetch_object() : This function returns an object with properties that correspond to the fetched row.

Each data set contains a unique id element, int & a … Continue Reading

Get months from two date range in PHP

Here is the code you are looking for:

function get_months($date1, $date2) {
$time1 = strtotime($date1);
$time2 = strtotime($date2);
$my = date(‘n-Y’, $time2);
$mesi = array(‘Jan’,’Feb’,’Mar’,’Apr’,’May’,’Jun’,’Jul’,’Aug’,’Sep’,’Oct’,’Nov’,’Dec’);

//$months = array(date(‘F’, $time1));
$months = array();
$f = ”;

while($time1 < $time2) {
if(date('n-Y', $time1) != $f) {
... Continue Reading

How to download remote file with CURL using PHP

You can read the response and store it to the disk.
Use below code to get your job done.
<?php
$url = ‘http://yourdomain.com/path/filename.ext';
$file_path = ‘/path/foldername/filename.ext';

$fp = fopen($path, ‘w’);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fp);

$response = curl_exec($ch);
?>
That’s all. Now you can download file hassle free.

Jari work Bhagalpuri Sarees with stone work

Smit Collection has new collection in Bhagalpuri Saree’s, pure silk with jari stone work.

img108

 

Visit our website for more details:

http://kapilsakhare.in/smitcollection/gallery/bhgalpursaree_vol1

Disclaimer : There might be slight variations in color due to lighting effect while taking the photo.
To order call us 096 73 841275 or write us at smitcollection.pune@gmail.com

Sending Emails from Amazon SES using PHP

Here the PHP code to send emails from Amazon SES.
require_once(‘ses.php’);

$objSes = new SimpleEmailService(‘accessKey’, ‘secretKey’);

$send = new SimpleEmailServiceMessage();
$send->addTo(‘xxxx@example.com’);
$send->setFrom(‘Name <yourmail@example.com>’);
$send->setSubject(‘Amazon SES email!’);
$send->setMessageFromString(‘Awesome, you got the email.’);
$objSes->sendEmail($send);
You can get ses.php from

http://www.orderingdisorder.com/aws/ses/

!! Happy Coding !!

Chanderi Silk Dress Materials from Smit Collection

SMIT Collection has new chanderi silk Dress Materials!!!!

Exciting OFFER for this season.. Buy any Dress Material only at Just Rs. 950/- only … Hurry Up!

Disclaimer : There might be slight variations in color due to lighting effect while taking the photo.
To order call us or write us at smitcollection.pune@gmail.com

 

Chanderi Silk

Chanderi Silk

Older Posts »»