You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 01-Basic.php
+19-17Lines changed: 19 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
/*== 1. Environment Setup ==*/
3
3
// Web Server: Client - Server (Hardware) - Web Server (Apache/Nginx Software)
4
4
// Ways to Install: Manual Installationin and Configuration in OS, XAMPP type Server(Preconfigured, Cant Run Multiple Version of PHP or Database, Not For Production), Virtual Machine/Docker (Better Alternative)
5
-
// Run PHP Script in Command Line: cd directory - php index.php
5
+
// Run PHP Script in Command Line: cd directory -> php index.php
6
6
7
7
/*== 2. Basic Syntax ==*/
8
8
echo'PHP Print'; // If close php here, no need semicolon
9
9
echo'PHP', '', 'Print'; // Same Output as Above
10
10
print'PHP Print'; // Print has a return value 1, same Output of Echo
11
11
echoprint"PHP Print"; // Output: PHP Print1 , added 1 at last
12
12
// Print could be used in expression like if(print()), echo cant: print echo will not work
trigger_error('File ' . $fileName . ' does not exist', E_USER_ERROR);
20
+
}
21
+
22
+
$file = fopen($fileName, 'r');
23
+
fgetcsv($file); // Exclude the Header, First Line
24
+
25
+
$transactions = [];
26
+
27
+
while(($transaction = fgetcsv($file)) !== false){
28
+
if($transactionHandler !== null){
29
+
$transaction = $transactionHandler($transaction);
30
+
} // Here, we will use extractTransaction(). But we can have different row format in another file, so for flexibility, we took this formatting method as callback argument
0 commit comments