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,520 points
572 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,840 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,840 points
22,151 views
0 votes
0 answers

How to retrieve data from multiple tables using a PHP form?

I want to retrieve data from multiple ...READ MORE

Jun 25, 2022 in PHP by narikkadan
• 63,600 points
1,961 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,840 points
3,298 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,840 points
3,788 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,840 points
23,004 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,840 points
2,984 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,840 points
2,911 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,840 points
44,585 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,840 points
1,530 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,840 points
2,214 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP