Posts

Future of PHP

Image
Future of PHP Before talking about the eventual fate of PHP I might want to know all of you that PHP is a server-side programming dialect which is fundamentally intended for site advancement yet it can likewise be utilized for an intricate application simply like Java or C. PHP is a procedural and in addition Object-arranged dialect. source from w3techs What's more, these days around 78.9% sites are utilizing PHP as their server-side dialect. Here we are talking about the future of PHP so look this There is a list of well-known sites which are utilizing PHP. 1. Facebook 2. Wikipedia 3. Baidu 4. Yahoo! 5. Tumblr 6. Flickr 7. Wordpress 8. MailChimp 9. LAD Bible 10. Birchbox 11. SeatGeek 12. Fotolia 13. Flipkart 14. Digg 15. iStockPhoto Purposes for the notoriety of PHP are  Presently Laravel (PHP system) is giving aggressive highlights to make a presence in the programming scene.  There was some worry about speed however t

PHP 7.1 New Features

PHP 7.1 New Features PHP 7.1, the new minor adaptation of PHP is at long last here, with various new highlights, changes, and bug fixes. In this article, how about we take a gander at a portion of the great highlights in PHP 7.1. Like, Nullable Types Void Function Symmetric Array Destructuring Class Constant Visibility Iterable  P seudo-Type Multiple Exceptions Handling Support For Key's In List Negative String Offset Support For AEAD Convert Callables To Closures Asynchronous Signal Handling Support for Server HTTP/2 Stream Context Option Nullable Types Type affirmations for parameters and return esteem would now be able to be set apart as nullable by prefixing the sort name with a question mark. This connotes and additionally the predefined type, NULL can be passed as a parameter or returned as a value, separately. <?php function  test (): ? string {     return  'PHP test' ; } var_dump ( testReturn ()); function  testReturn (): ? string

Auto generate invoice number in php with financial year format?

Image
How to create auto generated invoice number in  PHP with financial year format? Here I am going to share one of my work to generate auto Invoice number in PHP along with current financial year just like 18-19/0000001, 18-19/0000002. <?php function invoiceId() { $db=getDB(); $max = $db->prepare("select max(id) mid from invoice_table"); $max->execute(); $row = $max->fetch(PDO::FETCH_BOTH); $mid= $row['mid']+1; $y=date('y'); $m=date('m'); $cy; $ny; if($m<4) { $cy=$y-1; $ny=$y; } else { $cy=$y; $ny=$y+1; }  $id =$cy."-".$ny."/".str_pad($mid, 8, "0", STR_PAD_LEFT);  return $id; } ?> just call this function while inserting record it will return id.