How to Initializing Multiple PHP Variables Simultaneously

0 votes

How may I initialize multiple PHP variables with a value of zero simultaneously without using an array? I wish to write code that is essentially equivalent to the following:

$first = 0;
$second = 0;
$third = 0;
$fourth = 0;
Nov 5, 2020 in PHP by kartik
• 37,510 points
45 views

1 answer to this question.

0 votes

Hello @kartik,

Simply try this:

$first = $second = $third = $fourth = 0;
answered Nov 5, 2020 by Niroj
• 82,720 points

Related Questions In PHP

0 votes
1 answer

How to pass multiple variables to another page in url?

Hello @kartik, Use the ampersand & to glue variables together: $url ...READ MORE

answered Nov 23, 2020 in PHP by Niroj
• 82,720 points
581 views
0 votes
1 answer

How to Validate Form Data With PHP?

Hey @kartik, The first thing we will do ...READ MORE

answered Feb 13, 2020 in PHP by Niroj
• 82,720 points
566 views
0 votes
1 answer

What is a Cookie? How to create Cookies With PHP?

A cookie is often used to identify ...READ MORE

answered Feb 13, 2020 in PHP by Niroj
• 82,720 points
1,037 views
0 votes
1 answer

How to validate E-mail and URL of Php form?

hey, The code below shows a simple way ...READ MORE

answered Feb 13, 2020 in PHP by manish
579 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,720 points
7,118 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,720 points
814 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,720 points
632 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,720 points
7,540 views
0 votes
1 answer

How to Debug Variables like in PHP var_dump()?

Hello @kartik, Try out with the Smarty Session: {$smarty.session|@debug_print_var} or {$smarty.session|@print_r} To ...READ MORE

answered Apr 20, 2020 in PHP by Niroj
• 82,720 points
441 views
0 votes
1 answer

How to remove GET-variables with PHP?

Hello @kartik, Try this: preg_replace('/\\?.*/', '', $str) Hope ...READ MORE

answered Oct 27, 2020 in PHP by Niroj
• 82,720 points
137 views