Author:
webinfinite
Mar
4
A PHP switch statement is almost like an IF statement except it is good to use a switch statement when you want to compare many results on the same variable.
Example with integer.
Example with a string.
<?php
switch?($i)?{
case "eagle:
echo "i?is eagle";
break;
case "hawk":
echo "i?is hawk";
break;
case "blue jay":
echo "i?is blue jay";
break;
}
?>
Author:
webinfinite
Mar
3
There are over 700 functions available in php and below I will show you how to create you own function.? Functions all start with the word function(). Here are some things to remember
- name your functions based on what a function does
- { start your function
- put your code
- } end your function
- call your function
<?php function fullname($firstname){ // Start your function with an appropriate function name
// Put your code
$last_name = “Smith”;
$full_name= $first_name . ” ” . $last_name;
return $full_name;
} // end your function
<?PHP echo fullname(Joe); ?> //Calling this function will display Joe Smith
Author:
webinfinite
Mar
2
So you want to separate your string using explode or join your string using implode in vb.net? Explode/implode are functions of the php environment and do not exist in asp.net therefore you must use the split() function to get your results for explode and join() for implode.
Split() Example
mystring = “hello;sir;how are you”;
arrayData=mystring.Split(mystring
,”;”)
Result
arrayData(0) would equal “hello”
arrayData(1) would equal “sir”
arrayDate(2) would equal “how are you”
Dim JoinArray(3)
JoinArray(0) = "Welcome"
JoinArray(1) = "to"
JoinArray(2) = "Web Infinite"
Dim strSentence as String
strSentence = join(JoinArray)
Result
strSentence would equal to “Welcome to Web Infinite”
Filed under:
Asp.net, PHP
Author:
webinfinite
Feb
28
Here?s a great website that will transform PHP into html for pasting into WordPress, forums, or anywhere. It?s here.
Filed under:
PHP, Wordpress