Set - 2

Question 6 :

What is the functionality of the functions STRSTR() and STRISTR()?

Answer :

string strstr ( string haystack, string needle ) returns part of haystack string from the first occurrence of needle to the end of haystack. This function is case-sensitive. 
stristr() is idential to strstr() except that it is case insensitive.


Question 7 :

When are you supposed to use endif to end the conditional statement?

Answer :

When the original if was followed by : and then the code block without braces.


Question 8 :

How can we send mail using JavaScript? 

Answer :

No. There is no way to send emails directly using JavaScript. 
But you can use JavaScript to execute a client side email program send the email using the "mailto" code. Here is an example:

function myfunction(form){
	tdata=document.myform.tbox1.value;
	location="mailto:mailid@domain.com?subject=...";
	return true;
}

 


Question 9 :

What is the functionality of the function strstr and stristr?

Answer :

strstr() returns part of a given string from the first occurrence of a given substring to the end of the string. For example: strstr("user@example.com","@") will return "@example.com".
stristr() is idential to strstr() except that it is case insensitive.


Question 10 :

What is the difference between ereg_replace() and eregi_replace()?

Answer :

eregi_replace() function is identical to ereg_replace() except that it ignores case distinction when matching alphabetic characters.