CSS update style file with PHP to see the last results / avoid cache

Use this little PHP trick to upgrade your dev skills and avoid wasting lots of time…

PHP Explode() example

This function is extremely useful when you need to deal with url variables that you need to explode and use the separately. Let me give you a simple example: you have the following url – https://example.com/archive/2021-02-10/diesel/

Sometimes you need to use the date in the url and other times you need to move the year at the back of the string to use it in another way somewhere in your code.

We can use the PHP explode() function to do this… but first, you need to get the url as a string, you can use this article to learn how to do that – Get actual link of website PHP, after you have the url, you need to isolate the exact string to use it separately.

In our study case we will use the variable in the url that you can get it by accessing $_GET[‘variable_name’].

After we have the $_GET var, we will use the explode function:

You can see this example in action here: php explode(); example

PHP + MySQL + jQuery = fuel-prices.eu

I developed fuel-prices.eu as a side project using data from the Weekly Oil Bulletin provided every week(or almost) by the European Commission. PHP and MySQL helped me with the back site work and chart.js helped me a lot with the chart and data representation of the Diesel and Euro-Super 95 data flows.

The data range is from 2015 inclusive to our present week.

I also have in plan to add to the database all of the data beginning from 2009, that means a lot of PHPmyAdmin work for me in the next future.

For more informations about this project you can contact me.

Get actual link of website PHP

Free PHP, HTML, CSS, JavaScript/TypeScript editor – CodeLobster IDE

In this article, we suggest you to get acquainted with the free editor of web languages – CodeLobster IDE. It is presented on the software market for a long time already, and it wins a lot of fans.

CodeLobster IDE allows you to edit PHP, HTML, CSS, JavaScript and TypeScript files, it highlights the syntax and gives hints for tags, functions and their parameters. This editor easily deals with those files that contain a mixed content.

If you insert PHP code in your HTML template, then the editor correctly highlights both HTML tags and PHP functions. The same applies to CSS and JavaScript/TypeScript code, which is contained in HTML files.

The program includes auto-completion function, which greatly speeds up the programmer’s work and eliminates the possibility of errors.

CodeLobster IDE provides contextual help on all supported programming languages, it uses the most up to date documentation at this moment, downloading it from official sites. So we can quickly get a description of any HTML tag, CSS attribute, PHP or JavaScript/TypeScript function by pressing the F1 key. 

The built-in PHP debugger allows you to execute PHP scripts step by step, sequentially moving through the lines of code. You can assign check points, view the process of the work of loops, and monitor the values of all variables during the execution of the script.

Other useful functions and features of the IDE:

  • A pair highlighting of parentheses and tags – you will never have to count parentheses or quotation marks, the editor will take care of it.
  • Highlighting of blocks, selection and collapsing of code snippets, bookmarks to facilitate navigation on the edited file, recognition and building of the complete structure of PHP projects – these functions ensure easy work with projects of any scale.
  • Support for 17 user interface languages, among them English, German, Russian, Spanish, French and others.
  • The program works on the following operation systems: Windows 7, Windows 8, Windows 10, Mac OS, Linux, Ubuntu, Fedora, Debian.

The professional version of CodeLobster IDE provides the programmer with even more features.

For example, you have an opportunity to work with projects on a remote server with use of the built-in FTP client. You can edit the selected files, preview the results and then synchronize the changes with the files on the hosting.

In addition the professional version includes an extensive set of plug-ins:

  • Fully implemented support for JavaScript (and TypeScript) libraries, such as jQuery, Node.js, AngularJS, AngularTS, BackboneJS, EmberJS, VueJS and MeteorJS.
  • A large set of extensions that help to work with PHP frameworks – CakePHP, CodeIgniter, Laravel, Phalcon, Smarty, Symfony, Twig and Yii plug-ins.
  • Plugins for working with the most popular CMS – Drupal, Joomla, Magento and WordPress.
  • Also CodeLobster IDE has special plug-in for Bootstrap.

We can download and install any framework directly from the program without being distracted from the main tasks.

In general, for a year of work, our team had no complaints against the editor. CodeLobster IDE works fast, does not hang and allows us to work even with large PHP projects.

You can download CodeLobster IDE from the original website http://www.codelobster.com/.

PHP – make timestamp from normal date/time string

Demo here.

Download(Forced) PDF file with PHP HEADER

Send data to PHP via AJAX and get response

This is the simple script that I use every time I build one page sites… I use this code to update, delete, modify, add data to Mysql or other DB’s…

This code also get the class or id of the clicked link and can display a result there or in another div… this script can also be modified to play other important parts in the web app…

Hope it helps.

PHP – set hour to Eastern European Time(Bucharest)

This is the test script, you normally just need the first line of code.
Enjoy!