Skip to content
pontikis.net
  • Blog
  • WordPress
  • Labs
  • About
  • Toggle website search
Search this website
Menu Close

php

  1. Home>
  2. Blog>
  3. php>
  4. php
Read more about the article Determine PHP script Invocation: CLI or by the Web Server
Credits

Determine PHP script Invocation: CLI or by the Web Server

  • Post author:Christos Pontikis
  • Post published:September 13, 2013
  • Post category:Web Development
  • Reading time:2 mins read

In most cases you can distinguish if a PHP script was invoked from the command line (or Cron) or by the web server, using php_sapi_name(). php_sapi_name() will return cli on…

Continue ReadingDetermine PHP script Invocation: CLI or by the Web Server
Read more about the article Replace accented characters with non accented with PHP
Credits

Replace accented characters with non accented with PHP

  • Post author:Christos Pontikis
  • Post published:September 9, 2013
  • Post category:Web Development
  • Reading time:4 mins read

Sometimes you need to replace accented characters with non accented, for example when you want to perform an accent insensitive search. A solution could be the following function: <?php /**…

Continue ReadingReplace accented characters with non accented with PHP
Read more about the article Check if a string represents a valid Date or Time with PHP
Credits

Check if a string represents a valid Date or Time with PHP

  • Post author:Christos Pontikis
  • Post published:September 8, 2013
  • Post category:Web Development
  • Reading time:4 mins read

PHP DateTime class, available with PHP versions greater than 5.2 is very powerful. As an example, it ts very easy to check if a string represents a valid date or…

Continue ReadingCheck if a string represents a valid Date or Time with PHP
Read more about the article How to Parse an include file and Store the result in a Variable with PHP
Credits

How to Parse an include file and Store the result in a Variable with PHP

  • Post author:Christos Pontikis
  • Post published:September 2, 2013
  • Post category:Web Development
  • Reading time:3 mins read

Use of include is very common in PHP. include will parse a file and display the result. But, how to store the result in a variable for later use? In…

Continue ReadingHow to Parse an include file and Store the result in a Variable with PHP
Read more about the article How to Get Current Datetime (NOW) with PHP
Credits

How to Get Current Datetime (NOW) with PHP

  • Post author:Christos Pontikis
  • Post published:August 30, 2013
  • Post category:Web Development
  • Reading time:4 mins read

To get current datetime (now) with PHP you can use date with any PHP version, or better datetime class with PHP >= 5.2 Various date format expressions are available here.…

Continue ReadingHow to Get Current Datetime (NOW) with PHP
  • Go to the previous page
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • Go to the next page

Categories

Archives

NewsLetter

Click here to subscribe to our free email newsletter.
Unsubscribe anytime with a click.

LIKE OUR PAGE!


Say Hello to Gutenberg with my new Free WordPress Plugin Boilerplate for Developers!

Star it on Github!


  • Opens in a new tab
  • Opens in a new tab
  • Opens in a new tab
  • Opens in a new tab
  • Opens in a new tab
  • Opens in a new tab
  • Opens in a new tab
  • Contact
  • Privacy
  • Terms
© Christos Pontikis 2013 - 2025
Close Menu