£-PHP Preprocessor: Make Your PHP Code So British!

Because coding with £ is ever so much more stylish than $!

Introduction

Well, hello there, old sport! Today, let me introduce you to a project as original as it is elegant: the £-PHP Preprocessor. Why settle for the mundane $ in your PHP variables when you can show off your refinement with a splendid £? Tea time and code, hand in hand!

What is the £-PHP Preprocessor?

This preprocessor allows you to write your PHP variables with the £ symbol (pound sterling, of course), then automatically converts your code to classic PHP syntax. A little posh touch that is sure to impress your colleagues... or the Queen!

Features

  • So British Variables: Write £favourite_tea instead of $favourite_tea. Isn’t that smashing?
  • Easy Preprocessing: A simple script to translate your .phps files into ready-to-use .php files.
  • No-nonsense Design: As simple and effective as a good scone.

Installation

  1. Clone the repository:
                                git clone https://github.com/Paul-FranckDencausse/British-PHP-preprocessor-project-cd lovely-php-preprocessor
  2. Make sure you have PHP installed on your machine. (It’s terribly uncivilised not to.)

Usage

Write your code
£tea = "Earl Grey, hot";
echo £tea;
Tea Earl Grey Hot
Preprocess your code
php preprocessor.php

Your my_code.phps file will be translated into my_code_translated.php:

$tea = "Earl Grey, hot";
echo $tea;
Run as usual
php my_code_translated.php

Tea-tastic! 🎉

Contributing (with elegance)

  1. Fork the project
  2. Create a branch with a jolly good name
  3. Code while sipping tea
  4. Send a pull request for a proper chinwag

Acknowledgements and Licence

A hearty cheers to:

  • Tea, for fuelling all those late-night coding sessions
  • The pound sterling, for the inspiration
  • You, dear user, for keeping PHP so classy

Licence: Tea & Crumpets License.
By using this project, you agree to drink at least one cup of tea during development and to say “cheers” every time you deploy. God save the variables! 💂‍♀️

Update: Now with British to American Spelling Conversion!

The £-PHP Preprocessor just got even more clever! In addition to converting your posh £ variables into classic $ for PHP, the preprocessor now automatically translates common British English words into their American English equivalents.

For example, colour becomes color, favourite becomes favorite, and organise becomes organize—all without you lifting a finger. This ensures your code is not only stylishly British in the writing phase, but also universally understood when executed or shared with your American colleagues.

How does it work?
  1. Reads your .phps file with £ variables and British spellings.
  2. Replaces £ with $ for PHP compatibility.
  3. Automatically swaps out British spellings for their American counterparts using a handy dictionary.
  4. Saves and runs the translated PHP file as usual.
Example:
£favourite_colour = "blue";
echo £favourite_colour;

After preprocessing, your code becomes:

$favorite_color = "blue";
echo $favorite_color;

Whether you’re coding for Her Majesty or Uncle Sam, your PHP is now ready for both sides of the pond. Cheers to international code harmony!