Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/27/2021 in all areas

  1. 1 ) the bit before the => is the key, the bit following the => is the value. 2 ) Yes, associative 2b) indexed, or numeric, arrays 2c) But they can be mixed, for example $arr = [ 'This is a key' => 'This is a value', 42 => 'second value', 'Third value' ]; echo $arr['This is a key'] . '<br>'; echo '<pre>', print_r($arr, 1), '</pre>'; which outputs This is a value Array ( [This is a key] => This is a value [42] => second value [43] => Third value ) 3 ) I think the above example answers that.
    1 point
  2. RewriteConds only apply to the single next RewriteRule. They are not being applied to the second one. You can combine both RewriteRules by making the trailing slash optional, as in /? Why use a _FUNC constant? Just require each file inside the switch and be done with it. if(isset($_POST['user']) != 'lung'){ Copy/paste fail? isset() returns true or false. It does not return the value so comparing it to 'lung' does not work. Make the !isset check be first, then change this check to use a regular comparison. echo json_encode($error);die(); If you are sending JSON then you need to include a Content-Type header with the value of "application/json". Additionally, if you want to include a HTTP status code like 422 or 401 then you should actually send a HTTP response code.
    1 point
  3. Every element in an array has a key and a value A value may itself be an array So your would probably look something like this $questionnaire = [ 'title' => 'questionnaire one', 'intro' => 'Synopsis goes here', 'sections' => [ '1' => [ 'intro' => '', 'questions' => [ '1' => 'question 1 text', '2' => 'question 2 text' ] ], '2' => [ 'intro' => 'Some text here', 'questions' => [ '3' => 'question 3 text', '4' => 'question 4 text' ] ] ] ]; which could come from data like this +---------------------+ | questionnaire | +---------------------+ | quaire_id |-----+ | title | | | intro | | +---------------------+ | +-----------------+ | | section | | +-----------------+ | | section_id |------+ +-------<| quaire_id | | | section_no | | | intro | | +-----------------+ | +-------------------+ | | question | | +-------------------+ | | q_id | +----------<| section_id | | q_number | | q_text | +-------------------+
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.