String Separation
str_replace function
str_replace is a string function that replaces occurrences of a substring with another substring.
Syntax:
str_replace(find, replace, string, count)
Parameters:
-find: The substring to search for.
-replace: The substring to replace with.
-string: The original string.
-count(optional): The number of replacements made.
Example:
$string = "Hello, welcome world!";
$new_string = str_replace("world", "universe", $string);
echo $new_string;
// Output: "Hello, universe!"
strlen() fnction
is a PHP function that returns the length of a string.
Syntax:
strlen(string)
Parameter:
-string: The input string
Return Value:
The length of the string (integer).
Example:
$string = "Hello, World!";
$length = strlen($string);
echo $length;
// Output: 13
[Google Ads]
PHP->IMAGE UPLOAD : (UPLOAD IMAGES using Move upload function)
$image_file1 = $_FILES['file']['name'];
$c1 = rand(0,9);$c2 = rand(0,9);$c3 = rand(0,9);$c4 = rand(0,9);
$rand = $c1.$c2.$c3.$c4;
$date = mktime();
if($image_file1!='') {
move_uploaded_file($_FILES['file']['tmp_name'],'../video/'.$rand.$_FILES['file']['name']);
$path1 = '../video/'.$rand.$_FILES['file']['name'];
}
=================================================================================================
PHP->JAVASCRIPT VALIDATION : (for listbox checked)
var Item=form.template.selectedIndex;
var Result=form.template.options[Item].value;
if(Result=="")
{
alert("select anyone of the template");form.template.focus();return false;
}
---------------------------------------
$date = date('l,F j,Y');
monday,june 15 2009
---------------------------------------
worldwebsiteservice
------------------------------------------
$t_query="select a.id,a.name,a.password,a.mobile,a.referid,a.ledgerid,a.emailid,a.datetime,b.pinno as pinno,b.status,b.refererid,b.ledgerid from " . MEMBER . " a , ".PINDETAILS." b where (a.referid=b.refererid and a.ledgerid=b.ledgerid and b.status='active') order by a.id desc Limit $from, $maxresults";
$total_results = mysql_result(mysql_query("select COUNT(a.id),COUNT(a.name),COUNT(a.password),COUNT(a.mobile),COUNT(a.referid),COUNT(a.ledgerid),COUNT(a.emailid),COUNT(a.datetime) from " . MEMBER . " a , ".PINDETAILS." b where (a.referid=b.refererid and a.ledgerid=b.ledgerid and b.status='active' and a.block='') order by a.id desc" ),0);
--------------------------------------------------
$path= "photos/".$HTTP_POST_FILES['ufile']['name'][0];
copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path);
-----------------------------------------------------------------
-----------------------------------------------------------------------
var plan2=document.form1.plan2.checked;
var plan3=document.form1.plan3.checked;
if(plan1==true)
{
document.getElementById("plan2").disabled =true;
document.getElementById("plan3").disabled =true;
}
--------------------------------------------------------------------------
$findings_text="findingsid";
$findings_text_text1="";
$findings_text_text2='>';
$findings=array();
$typeword=str_replace("'","",$typeword);
$findings_text_array=explode($findings_text,$typeword);
for($w=1;$w
$findings_text_rec1=$findings_text_array[$w];
$findings_text_array1=explode($findings_text_text1,$findings_text_rec1);
$findings_text_rec2=$findings_text_array1['0'];
$findings_text_rec3= html_entity_decode(strip_tags($findings_text_rec2));
$findings_text_array2=explode($findings_text_text2,$findings_text_rec3);
$sizee=sizeof($findings_text_array2);
$FINDINGS=$findings_text_array2[$sizee-1];
$FINDINGS1=str_replace(" ","",$FINDINGS);
$findings_text_len=strlen($FINDINGS1);
$fchar+=$findings_text_len;
$findings[$w]=$FINDINGS;
}
[Google Ads]