Friday, 3 August 2018
'adb' is not recognized as an internal or external command, operable program or batch file.
'adb' is not recognized as an internal or external command,operable program or batch file.
Step 1
I have windows 10. Here is adb.exe is located. Copy the following path.Step 2:
Go to control panel and click Advanced system settings.
Step 3: Click Environment Variable button.
Step 4
Select Path button and Click Edit buttonStep 5:
Paste the adb path here and then click ok and ok
Step 6:
Run again command prompt and type abd.Sunday, 22 December 2013
Wednesday, 18 December 2013
Switch in PHP examples
Example No.1
<?php
$week = "Friday";
switch($week)
{
case "Sunday":
echo "Today is Sunday";
break;
case "Monday":
echo "Today is Monday";
break;
case "Tuesday":
echo "Today is Tuesday";
break;
case "Wednesday":
echo "Today is Wednesday";
break;
case "Thursday":
echo "Today is Thursday";
break;
case "Friday":
echo "Today is Friday";
break;
case "Saturday":
echo "Today is Saturday";
break;
}
?>
output:
Today is Friday
Example No.2
using default in switch
<?php
$week = "Notavailble";
switch($week)
{
case "Sunday":
echo "Today is Sunday";
break;
case "Monday":
echo "Today is Monday";
break;
case "Tuesday":
echo "Today is Tuesday";
break;
case "Wednesday":
echo "Today is Wednesday";
break;
case "Thursday":
echo "Today is Thursday";
break;
case "Friday":
echo "Today is Friday";
break;
case "Saturday":
echo "Today is Saturday";
break;
default:
echo "This weekend is not availabe in our list";
}
?>
output:
This weekend is not availabe in our list
Example NO.3
Always used break keyword in the end of case body.Otherwise you got wrong output.Following example shows What you got when you did not used break keyword
<?php
$week = "Sunday";
switch($week)
{
case "Sunday":
echo "Today is Sunday";
case "Monday":
echo "Today is Monday";
case "Tuesday":
echo "Today is Tuesday";
case "Wednesday":
echo "Today is Wednesday";
case "Thursday":
echo "Today is Thursday";
case "Friday":
echo "Today is Friday";
case "Saturday":
echo "Today is Saturday";
default:
echo "This weekend is not availbe in our list";
}
?>
output:
Today is SundayToday is MondayToday is TuesdayToday is WednesdayToday is ThursdayToday is FridayToday is SaturdayThis weekend is not availbe in our list
<?php
$week = "Friday";
switch($week)
{
case "Sunday":
echo "Today is Sunday";
break;
case "Monday":
echo "Today is Monday";
break;
case "Tuesday":
echo "Today is Tuesday";
break;
case "Wednesday":
echo "Today is Wednesday";
break;
case "Thursday":
echo "Today is Thursday";
break;
case "Friday":
echo "Today is Friday";
break;
case "Saturday":
echo "Today is Saturday";
break;
}
?>
output:
Today is Friday
Example No.2
using default in switch
<?php
$week = "Notavailble";
switch($week)
{
case "Sunday":
echo "Today is Sunday";
break;
case "Monday":
echo "Today is Monday";
break;
case "Tuesday":
echo "Today is Tuesday";
break;
case "Wednesday":
echo "Today is Wednesday";
break;
case "Thursday":
echo "Today is Thursday";
break;
case "Friday":
echo "Today is Friday";
break;
case "Saturday":
echo "Today is Saturday";
break;
default:
echo "This weekend is not availabe in our list";
}
?>
output:
This weekend is not availabe in our list
Example NO.3
Always used break keyword in the end of case body.Otherwise you got wrong output.Following example shows What you got when you did not used break keyword
<?php
$week = "Sunday";
switch($week)
{
case "Sunday":
echo "Today is Sunday";
case "Monday":
echo "Today is Monday";
case "Tuesday":
echo "Today is Tuesday";
case "Wednesday":
echo "Today is Wednesday";
case "Thursday":
echo "Today is Thursday";
case "Friday":
echo "Today is Friday";
case "Saturday":
echo "Today is Saturday";
default:
echo "This weekend is not availbe in our list";
}
?>
output:
Today is SundayToday is MondayToday is TuesdayToday is WednesdayToday is ThursdayToday is FridayToday is SaturdayThis weekend is not availbe in our list
Call by refrence in PHP
Following example show orignal value of parameter change.
<?php
function orignalValueChange(&$refParameter)
{
$refParameter = 4;
}
$var = 23;
orignalValueChange($var);
echo $var;
?>
output:
4
Following example show orignal value of parameter not change.
<?php
function orignalValuenotChange($refParameter)
{
$refParameter = 4;
}
$var = 23;
orignalValuenotChange($var);
echo $var;
?>
output:
23
function callbyref(&$para1, &$para2,&$para3)
{ $para1 = $para2 = $para3;
}
$var1 = 1000;
$var2 = 2000;
$var3 = 3000;
callbyref($var1, $var2,$var3);
$var2 = 5;
echo "<br/>";
echo $var1;
?>
output:
3000
<?php
function orignalValueChange(&$refParameter)
{
$refParameter = 4;
}
$var = 23;
orignalValueChange($var);
echo $var;
?>
output:
4
Following example show orignal value of parameter not change.
<?php
function orignalValuenotChange($refParameter)
{
$refParameter = 4;
}
$var = 23;
orignalValuenotChange($var);
echo $var;
?>
output:
23
Example
<?phpfunction callbyref(&$para1, &$para2,&$para3)
{ $para1 = $para2 = $para3;
}
$var1 = 1000;
$var2 = 2000;
$var3 = 3000;
callbyref($var1, $var2,$var3);
$var2 = 5;
echo "<br/>";
echo $var1;
?>
output:
3000
Tuesday, 17 December 2013
Infinite loop using for loop and while loop in PHP
Followings scripts shows how to run a loop infinite.
<?php
for(; ;)
{
echo "infinte loop";
}
?>
<?php
while(true)
{
echo "infinte loop";
}
?>
Example 1
Using For loop<?php
for(; ;)
{
echo "infinte loop";
}
?>
Example2
Using While Loop<?php
while(true)
{
echo "infinte loop";
}
?>
Monday, 16 December 2013
Server Side PHP Date convert in javascript format.
Server Side PHP Date convert in javascript format.
Javascript is a client side scripting language.So when we dealing with dates in javascript.Some time we need the current date of Server using javascript.So we can get a unix time stamp in PHP using strtotime() function in PHP
So following Script give you server Side Date and time in Javascript.
Example
<script type="text/javascript">
var ServerSide = <?=strtotime("now")?>;
var today = new Date(ServerSide * 1000);
alert(today);
</script>
output
Thanks for reading
Subscribe to:
Posts (Atom)










