Search
 
SCRIPT & CODE EXAMPLE
 

PHP

sum two numbers in php

<?php  
$x=10;  
$y=20;  
$z = $x + $y;  
echo "Sum of x and y : ". $z;  
?>
Comment

php sum two arrays

<?php
$x=[10,15,50];
$y=[20,30,40];
$count=count($x);

for ($j = 0; $j <$count; $j++) {
        $z[$j] = $x[$j] + $y[$j];
    }
echo  join(",", $x)."<br>";
echo  join(",", $y)."<br>";
echo  join(",", $z)."<br>";

//output
//10,15,50
//20,30,40
//30,45,90


?> 
Comment

php sum 2 arrays

<?php
  $i = 1;
  $j = 2;
 $a = $i + $j;
echo "The sum of i and j will be" . $a;
?>
Comment

PREVIOUS NEXT
Code Example
Php :: Set post views count using post meta 
Php :: change varchar limit in migration file. 
Php :: php print array source code 
Php :: install php56-php-ldap on ubuntu 20.04 
Php :: symony type request 
Php :: php function return type self 
Php :: Route::any 
Php :: datetime-local laravel migration data type 
Php :: list database table rows plugin wordpress 
Php :: livewire component lost data 
Php :: how to save snap in webcap in php codeigniter 
Php :: Yii::$app-session 
Php :: how to compare two strings ignoring accentuation in php 
Php :: laravel route namespace and prefix 
Php :: voirs les cles etrangeres phpmyadmin 
Php :: php input seperated by space 
Php :: how to give dynamic value in onlick in php 
Php :: BelongsToMany relations pivot fields are null in Livewire refresh 
Php :: PHP strcspn — Find length of initial segment not matching mask 
Php :: keep track of view count php 
Php :: Unsupported type passed 
Php :: fat-free captcha plugin 
Php :: not have permision elgg settings.php 
Php :: Hide products only show assigned products to certain user roles in WooCommerce 
Php :: default php email prot 
Php :: strtotime last day of month 
Php :: where clause with paginate laravel multiple column 
Php :: Trying to get property 
Php :: laravel validate string 
Php :: php get site metat tags 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =