Commit a8c5c8b8571771d506c2d483c0ddfbe76e1be380
Commits[COMMIT BEGIN]commit a8c5c8b8571771d506c2d483c0ddfbe76e1be380 Author: 0x4248 <[email protected]> Date: Tue Dec 16 22:22:19 2025 +0000 lab/trail: Add PHP code Signed-off-by: 0x4248 <[email protected]> diff --git a/.gitignore b/.gitignore index baab0bd..4dbcb03 100644 --- a/.gitignore +++ b/.gitignore @@ -101,4 +101,5 @@ COMMIT_MSG.old !*.py !*.sh !*.bash -!*.fish \ No newline at end of file +!*.fish +!*.php \ No newline at end of file diff --git a/lab/trail/README.md b/lab/trail/README.md index a8ca534..8faf886 100644 --- a/lab/trail/README.md +++ b/lab/trail/README.md @@ -1,8 +1,8 @@ -The C/C++ Trail -=============== +The Language Trail +=================== -What is The C/C++ Trail, well its like a hike trough the entire C and C++ library from -the beginning. +What is The Language Trail, well its like a hike trough the entire C and C++ library from +the beginning and as well as other major languages that I want to try out like PHP and Lua. *why?* diff --git a/lab/trail/c/header/ctype.c b/lab/trail/c/header/ctype.c index b7c8627..75226a7 100644 --- a/lab/trail/c/header/ctype.c +++ b/lab/trail/c/header/ctype.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-3.0 - * The C/C++ Trail + * The Language Trail * * ctype.c * diff --git a/lab/trail/c/header/errno.c b/lab/trail/c/header/errno.c index f4bf147..548b1e5 100644 --- a/lab/trail/c/header/errno.c +++ b/lab/trail/c/header/errno.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-3.0 - * The C/C++ Trail + * The Language Trail * * errno.c * diff --git a/lab/trail/c/header/math.c b/lab/trail/c/header/math.c index 8dbbebc..a242634 100644 --- a/lab/trail/c/header/math.c +++ b/lab/trail/c/header/math.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-3.0 - * The C/C++ Trail + * The Language Trail * * math.c * diff --git a/lab/trail/php/hello.php b/lab/trail/php/hello.php new file mode 100644 index 0000000..2c46ab4 --- /dev/null +++ b/lab/trail/php/hello.php @@ -0,0 +1,18 @@ +#!/usr/bin/env php +<?php +# SPDX-License-Identifier: GPL-3.0 +# The Language Trail +# +# hello.php +# Hello world in PHP +# +# COPYRIGHT NOTICE +# Copyright (C) 2025 0x4248 and contributors +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the license is not changed. +# +# This software is free and open source. Licensed under the GNU general +# public license version 3.0 as published by the Free Software Foundation. + +echo "Hello World\n"; +?> \ No newline at end of file diff --git a/lab/trail/php/html.php b/lab/trail/php/html.php new file mode 100644 index 0000000..19b2f0f --- /dev/null +++ b/lab/trail/php/html.php @@ -0,0 +1,29 @@ +<!-- SPDX-License-Identifier: GPL-3.0 +The Language Trail + +html.php +HTML generation in PHP + +COPYRIGHT NOTICE +Copyright (C) 2025 0x4248 and contributors +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the license is not changed. + +This software is free and open source. Licensed under the GNU general +public license version 3.0 as published by the Free Software Foundation. --> + +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>PHP HTML Example</title> +</head> +<body> + <h1>Welcome to PHP HTML Generation</h1> + <p><?php + // Simple PHP code to display the current date and time + echo "Current date and time is: " . date("Y-m-d H:i:s"); + ?></p> +</body> +</html> + diff --git a/lab/trail/php/math.php b/lab/trail/php/math.php new file mode 100644 index 0000000..a6a6214 --- /dev/null +++ b/lab/trail/php/math.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +<?php +# SPDX-License-Identifier: GPL-3.0 +# The Language Trail +# +# math.php +# Math operations in PHP +# +# COPYRIGHT NOTICE +# Copyright (C) 2025 0x4248 and contributors +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the license is not changed. +# +# This software is free and open source. Licensed under the GNU general +# public license version 3.0 as published by the Free Software Foundation. + +$a = 10; +$b = 3; +$sum = $a + $b; +$product = $a * $b; +echo "Sum: $sum\n"; +echo "Product: $product\n"; + +# More advanced math functions +$squareRoot = sqrt($a); +$power = pow($a, $b); +echo "Square root of $a: $squareRoot\n"; +echo "$a raised to the power of $b: $power\n"; + + +?> \ No newline at end of file[COMMIT END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.