Do I deduce the data from the array into a variable?

Hello! Do I organize the data output from the array into a variable?
$curws = $_POST ['wslist'];
$cursite = mysqli_query ($connection, "SELECT * FROM $dbtable WHERE name = '$curws' ");
$cursitearr = mysqli_fetch_array ($cursite);
$name = $cursitearr['name'];
$alias = $cursitearr['alias'];
$indexfiles = $cursitearr['indexfiles'];
$charset = $cursitearr['charset'];
$email = $cursitearr['email'];
July 2nd 19 at 17:03
2 answers
July 2nd 19 at 17:05
Hello! Do I organize the data output from the array into a variable?
in General, I think Yes, but I don't understand why You need it?

To use the data, for example, in the string, you can use the "master" variable, in the same way, for example:
$myString = "mailbox: {$cursitearr['email']} has been sent notification";


Similarly their (variable with result of samples / arrays) you can continue to use the code.
July 2nd 19 at 17:07
You can still use the function list
list($name, $alias, $indexfiles, $charset, $email) = $cursitearr;
the then extract() ) - eugene_Kshleri commented on July 2nd 19 at 17:10
: Yes, that's right :) - nicklaus.Will commented on July 2nd 19 at 17:13
A pity that it is impossible for a review to vote. - Giles_Luettgen18 commented on July 2nd 19 at 17:16

Find more questions by tags PHP