Featured Post

What is the purpose of the php.ini file?

  The PHP configuration file,   php.ini , is the final and most immediate way to affect PHP's functionality. The php.ini file is read ea...

Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Difference between echo and print?

 

echoprint
Can output multiple strings    Outputs one string only
Faster    Slightly slower
No return value    Returns 1

How to Integrate Google Tag Manager with Drupal 9 - An Easy Step-by-Step Tutorial

 Marketers are always seeking new ways to elevate website engagement and maximize interactivity. Yet, managing the countless third-party integrations and tracking tools implemented to enhance their business can quickly become overwhelming and chaotic. That's when Google Tag Manager comes to the rescue. With its intuitive and user-friendly platform, managing, updating, and tracking the snippets, tags, and integrations on your website has never been easier. From improving website performance to boosting conversion rates, Google Tag Manager offers the solution to streamline your digital marketing efforts and revolutionize your online presence.

Drupal 9 makes integrating with Google Tag Manager easy and effortless. The Google tag manager module in Drupal lets you quickly add, modify and remove tags on your website without touching any code! Read this easy step-by-step guide to learn how to integrate your Drupal 9 site with your Google tag manager.

GTM with Drupal

What is the purpose of the php.ini file?

 The PHP configuration file, php.ini, is the final and most immediate way to affect PHP's functionality. The php.ini file is read each time PHP is initialized. in other words, whenever httpd is restarted for the module version or with each script execution for the CGI version.

How do you enable error reporting in PHP?

 PHP allows us to choose whether or not to display errors to users. There are three ways to enable or disable error reporting in PHP:

Method 1: You can turn the display error parameter in the php.ini file on or off. When it’s on, errors are shown; when it’s off, there are no errors shown or reported. To do this, locate the display error parameter in the php.ini file, then set its value to “on.” Restart the web server's various services. The PHP script's errors will now be visible to end users. Set the display error parameter to “off” to stop reporting errors. The off argument indicates that users won't see any errors.

Method 2: Using the mini set() function is the second way to enable or stop error reporting. The ability to modify the configuration options in the php.ini file is a built-in feature of the PHP programming language. It requires two inputs: the name of the setting you want to change and the value you want to assign.

Method 3: You can also utilize the error reporting() function, a native PHP function, to enable error reporting. This function controls which PHP faults are reported and sets the error reporting directive during runtime. Given that PHP has multiple error levels, this method also aids in setting the various levels for the runtime (duration) of your script. This function accepts parameters for error names like E ERROR, E WARNING, E PARSE, etc., allowing these errors to be reported.

How to Create Custom Post Types in WordPress

 We only get three built-in content types at the backend when we install WordPress, i.e., posts, pages, and media. However, today WordPress has become quite flexible and advanced.

The approach to adding more post types also has expanded. The diversified usage demands more content types because posts, pages, and media are not enough, and here is where WordPress custom post type comes in handy.

What Is a WordPress Custom Post Type?

Custom post types are used to convert a regular WordPress website into a content management system. As the name suggests, you can use custom post types to create various content types for your website.

Besides that, one can find several post types available by default in WordPress installation, including:

  • Post – blog post
  • Page – static page
  • Attachment – attached media
  • Revision – post revision
  • Navigation Menu – nav menu
  • WordPress supports an unlimited number of Custom Post Types. You can create your custom posts and call them up wherever you want.
  • For example, if you run a News website and want to add a custom post type titled “News.” Once created, the news post-type would have its own menu in the WordPress dashboard admin area. Additionally, you can create multiple post types, such as Movies, Portfolios, etc.

What Is a WordPress Custom Post Type?

Custom post types are used to convert a regular WordPress website into a content management system. As the name suggests, you can use custom post types to create various content types for your website.

Besides that, one can find several post types available by default in WordPress installation, including:

  • Post – blog post
  • Page – static page
  • Attachment – attached media
  • Revision – post revision
  • Navigation Menu – nav menu
  • WordPress supports an unlimited number of Custom Post Types. You can create your custom posts and call them up wherever you want.

    For example, if you run a News website and want to add a custom post type titled “News.” Once created, the news post-type would have its own menu in the WordPress dashboard admin area. Additionally, you can create multiple post types, such as Movies, Portfolios, etc.

  • Follow the steps below to create a custom post type on a WordPress website:

    • Navigate to the function.php file from your WordPress theme directory
    • Add the following code to the function.php file
    1. /* Custom Post Type Start */
    2. function create_posttype() {
    3. register_post_type( 'news',
    4. // CPT Options
    5. array(
    6. 'labels' => array(
    7. 'name' => __( 'news' ),
    8. 'singular_name' => __( 'News' )
    9. ),
    10. 'public' => true,
    11. 'has_archive' => false,
    12. 'rewrite' => array('slug' => 'news'),
    13. )
    14. );
    15. }
    16. // Hooking up our function to theme setup
    17. add_action( 'init', 'create_posttype' );
    18. /* Custom Post Type End */
    • Once you’ve added the code, the News post-type will automatically appear in the admin area

Difference between Abstract class and Interfaces.

Abstract class:

  • Abstract class comes under partial abstraction.
  • Abstract classes can maintain abstract methods and non abstract methods.
  • In abstract classes, we can create the variables.
  • In abstract classes, we can use any access specifier.
  • By using 'extends' keyword we can access the abstract class features from derived class.
  • Multiple inheritance is not possible.

Interface:

  • Interface comes under fully abstraction.
  • Interfaces can maintain only abstract methods.
  • In interfaces, we can't create the variables.
  • In interface, we can use only public access specifier.
  • By using 'implement' keyword we can get interface from derived class.
  • By using interfaces multiple inheritance is possible.

The Difference Between Abstract Class and Interface in PHP

 

Introduction 

 
Before diving deep into the difference between abstract class and interfaceyou must understand one basic thing: these are two completely different classes that cannot be used as an alternative to one another.
 
Interface classes completely empty the shells while expecting child classes to implement everything for them. Abstract classes not only contain the common piece of information between the shells inside but also expect the child classes within to fill in the gaps.
 
Let us dive in a bit deeper to actually understand the difference minutely.
 
If you want to read about PHP Array questions then you can visit here. This will help you crack your PHP interviews.

What is Member Variable and Member function?

  Member Variable − These are the variables defined inside a class. This data will be invisible to the outside of the class and can be accessed via member functions. These variables are called attribute of the object once an object is created.

Member function − These are the function defined inside a class and are used to access object data.

SOLID Principles in PHP

This post is to provide an easy to understand idea about the implementation of one of the most “talked about” principles of Object Oriented Programming - SOLID principles. As a programmer, there might come a time when we are so consumed in finishing the task at hand that we forget the world around us. And in the very same world, somewhere lost are the programming principles that we read about and planned to use next time. So let’s try to look at the SOLID principles in one of the simplest way possible so that we can practice them while coding.

So let’s dig in to the SOLID principles at a glance.

  1. Single Responsibility: A Class should be responsible for a single task.
  2. Open-Close Principle: A Class should be open to extension and close to modification.
  3. Liskov Substitution: A derived Class can be substituted at places where base Class is used.
  4. Interface Segregation: Don’t make FAT Interfaces. i.e. Classes don’t have to override extra agreements that are not needed for that Class simply because it is there in interface.
  5. Dependency Inversion: Depend on abstractions, not on concretions. Not only high level Classes but low level Classes also depend on the abstractions in order to decouple the code.

What are different Clauses used in SQL?

 WHERE Clause: This clause is used to define the condition, extract and display only those records which fulfill the given condition.

Syntax:

SELECT column_name(s) 
 FROM table_name 
 WHERE condition;

GROUP BY Clause: It is used with SELECT statement to group the result of the executed query using the value specified in it. It matches the value with the column name in tables and groups the end result accordingly.

Syntax:

SELECT column_name(s)
 FROM table_name
 GROUP BY column_name;

HAVING clause: This clause is used in association with the GROUP BY clause. It is applied to each group of results or the entire result as a single group. It is much similar as WHERE clause but the only difference is you cannot use it without GROUP BY clause

Syntax:

 
SELECT column_name(s) 
 FROM table_name 
 GROUP BY column_name 
 HAVING condition;

ORDER BY clause: This clause is used to define the order of the query output either in ascending (ASC) or in descending (DESC). Ascending (ASC) is set as the default one but descending (DESC) is set explicitly.

Syntax:

SELECT column_name(s) 
 FROM table_name 
 WHERE condition 
 ORDER BY column_name ASC|DESC;

USING clause: USING clause comes in use while working with SQL JOIN. It is used to check equality based on columns when tables are joined. It can be used instead of the ON clause in JOIN.

Syntax:

SELECT column_name(s) 
 FROM table_name 
 JOIN table_name 
 USING (column_name);

What is the use of “echo” in php?

 It is used to print a data in the webpage, Example: , The following code print the text in the webpage

Is PHP a strongly typed language?

No. PHP is a weakly typed or loosely typed language.

This means PHP does not require to declare data types of the variable when you declare any variable like the other standard programming languages C# or Java. When you store any string value in a variable, then the data type is the string and if you store a numeric value in that same variable then the data type is an Integer.

Sample code:

$var = "Hello"; //String
$var = 10; //Integer

Why do we use PHP?

 There are several benefits of using PHP. First of all, it is totally free to use. So anyone can use PHP without any cost and host the site at a minimal cost.

It supports multiple databases. The most commonly used database is MySQL which is also free to use. Many PHP frameworks are used now for web development, such as CodeIgniter, CakePHP, Laravel, etc.

These frameworks make the web development task much easier than before.

What are tables in SQL?

 The table is a collection of record and its information at a single view.

Looking for PHP Developers

Experience required for the Job: 4 - 6 years
Job Location: Bengaluru/Bangalore
We are looking for PHP developers , please find the JD below

PHP Developer

Job brief

We are looking for a PHP developer who is dedicated to his craft, writes code that is proud of and can hit the ground running. We need you to write beautiful, fast PHP code to a high standard, in a timely and scalable way that improves the code-base of our products in meaningful ways.

You will be a part of a creative team that is responsible for all aspects of the ongoing software development from the initial specification, through to developing, testing and launching.

Responsibilities

Write "clean", well designed code
Produce detailed specifications
Troubleshoot, test and maintain the core product software and databases to ensure strong optimization and functionality
Contribute in all phases of the development lifecycle
Follow industry best practices
Develop and deploy new features to facilitate related procedures and tools if necessaryRequirements

Proven software development experience in PHP
Good knowledge of MVC design patterns
Good knowledge of object oriented PHP programming
Understanding of open source technologies like Drupal, RoR, Moodle, etc
Demonstrable knowledge of web technologies including HTML, CSS, Javascript, AJAX etc
Good knowledge of relational databases, version control tools and of developing web services
Experience in common third-party APIs (Google, Facebook, Ebay etc)
Passion for best design and coding practices and a desire to develop new bold ideas.

Yrs: 4-6yrs
Location: Bangalore

Interested candidates mail me at sibaji.patnaik@socialdnalabs.com

Excellent opportunity for immediate joiners

Experience required for the Job: 2 - 5 years
Job Location: Bengaluru/Bangalore
 Greetings from Veave Technologies!!!

Our Client is looking for exceptionally talented Professionals with the following Technologies:

I came across your resume on Job Portal and find that your skills match with a position we have for the Job 

Job Description :

Job Position: Magento Developer/Sr Developer
Education: B.E/B. Tech
Experience: 2-5 Yrs
Location: White Field, Bangalore
Position:3
Skills:* Should have worked on projects with Magento
* Will be better if Magento Certified
* Should have experience in customization, development of new extension on Magento
* Strong PHP 4 & 5, MySQL, AJAX, CSS, Smarty
* Strong knowledge of Zend framework, MySQL
* Familiarity with the SDLC and Scrum Methodologies
* Familiarity with Web 2.0

If you really interested in this position, please share your updated resume to ashvini@veave.in

Popular Posts