Display fieldnames of datafile
Code : (for display purposes, some lines wrap. The ↵ character indicates it. The character is not part of the code)
$path_to_db_script = $_SERVER['DOCUMENT_ROOT']↵ . "/" . "db/pjjtextbase.php"; require $path_to_db_script; $fieldnames = 'novels.csv'; $novels = ptb_connect ($fieldnames); echo "<p>Fieldnames of : <code>"↵ . $fieldnames . "</code>.</p>"; print_r (ptb_fieldnames ($novels));
Output :
Fieldnames of : novels.csv
.
Array ( [0] => id [1] => year [2] => @protagonist [3] => title [4] => %aka [5] => protagonist [6] => @nationality [7] => nationality [8] => aka )
⇪ Feb 17 2021 06:30:59