Mohammad Towhidul Islam

    13-Dec-21 01:09:19 am

    How to PHP class instance to JSON?

    <?php class Book implements JsonSerializable{ private $id; private $title; private $author; function __construct($_id,$_title,$_author){ $this->id=$_id; $this->title=$_title; $this->author=$_author; } public function jsonSerialize() { return get_object_var...

    Read More


    Mohammad Towhidul Islam

    15-Sep-21 11:47:13 am

    Difference between two dates in minutes using PHP

    Method 1 $start_date = new DateTime('2011-09-01 04:10:58'); $since_start = $start_date->diff(new DateTime('2021-09-11 10:25:00')); echo $since_start->days.' days total<br>'; echo $since_start->y.' years<br>'; echo $since_start->m...

    Read More


    MD. Shafiqul Islam

    06-Jun-18 02:22:52 pm

    PHP - Examination Question with Answer, Exam- 04, Round- 36 WDPF

    Part-02: MCQ Question with Answer
    1.What is the correct output from the code below?
    <?php $var = true; If !( $var){ echo "Hello, World!"; } ?> Ans: Code not be executed.
    2. What is the correct output from the code below?
    <?php $txt =”Bangladesh”; ec...

    Read More


    MD. Shafiqul Islam

    04-Jun-18 10:30:50 pm

    PHP - Examination Question with Solution, Exam- 04, Round- 36 WDPF

    Part-01: Descriptive Question with Answer. 1: What are the general language features of php? Answer Practicality: It requires minimum knowledge of programming. Power: It has the ability to interface with databases, form and create pages dynamically. Possibility: Developers are rarely bound to...

    Read More


    Mohammad Towhidul Islam

    30-Apr-16 06:49:12 pm

    The Adjacency List Model Tree using PHP

    <?php // this is for testing // replace with your database stuff // e.g. $data = $db -> getAll etc $data = array( array('id' => 11, 'parent' => 0), array('id' => 22, 'parent' => 11), array('id' => 33, '...

    Read More


    Mohammad Towhidul Islam

    23-Apr-16 10:08:31 am

    PHP Model Test Questions and Answers

    1. Define Heredocs and Nowdocs in PHP? Nowdocs and Heredocs are ideal for embedding PHP code or other large blocks of text without the need for escaping. Heredoc parse PHP variables and html elements within its block. $foo = 'here'; $here = <<<HERE I'm new $foo!...

    Read More


    Mohammad Towhidul Islam

    27-Jan-16 01:08:23 pm

    How to Resize Image Dynamically in PHP

    Today almost every website you visit show content in form of thumbnails. Thumbnails are nothing but images displayed next to the content. Be it News website or a blog, displaying images next to content is key to appeal user. Even our blog shows images as thumbnails on home page. A prerequisites to ...

    Read More


    Md. Moshiur Rahman

    22-Dec-15 08:23:05 am

    Shopping cart(increment by 1) by Moshiur Rahman

    #create a database drop database if exists shopping_cart; create database shopping_cart; use shopping_cart; create table products(id int(10) auto_increment primary key, product_name text, price text, uom text); insert into products(product_name,price,uom)values('mobile','5000',...

    Read More


    Mohammad Towhidul Islam

    10-Nov-15 11:13:54 am

    Create a shopping cart in PHP

    shopping.sql -- -- Table structure for table `customers` -- CREATE TABLE IF NOT EXISTS `customers` ( `serial` int(11) NOT NULL auto_increment, `name` varchar(20) collate latin1_general_ci NOT NULL, `email` varchar(80) collate latin1_general_ci NOT NULL, `address` varchar(80) collate...

    Read More


    Mohammad Towhidul Islam

    17-Oct-15 01:31:18 pm

    How to Create Thumbnail Images using PHP?

    <?php function create_thumb($src,$dest,$desired_width = false, $desired_height = false) { /*If no dimenstion for thumbnail given, return false */ if (!$desired_height&&!$desired_width) return false; $fparts = pathinfo($src); $ext = strtolower($fparts['extension'...

    Read More


First123Last
1 of 9 pages
Copyright © 2024. Powered by Intellect Software Ltd