PHP explode() Function

Definition and Usage

The explode() function breaks a string into an array.
Note: The "separator" parameter cannot be an empty string.
Note: This function is binary-safe.

Example

Break a string into an array:
<?php
$str = "My name is KC Verma";
print_r (explode(" ",$str));
?>

Result -
Array ([0] => My [1]=>name [2]=> is [3]=> KC [4] => Verma)

Syntax

explode(separator,string,limit)

ParameterDescription
separatorRequired. Specifies where to break the string
stringRequired. The string to split
limitOptional. Specifies the number of array elements to return.Possible values:
  • Greater than 0 - Returns an array with a maximum of limit element(s)
  • Less than 0 - Returns an array except for the last -limit elements()
  • 0 - Returns an array with one element

Comments

  1. that was awesome information thanks for sharing i know this is common one and every php developer have knowledge about it but i'm sure this will help to a person who is new in php

    ReplyDelete
  2. Nice Posting! because there are a lot of informative postings so, thanks a lot for sharing the information. Ecommerce website Designing in Mumbai || Ecommerce Solution || Ecommerce Solution in Mumbai

    ReplyDelete
  3. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me. Dynamic Website Designing || Dynamic website Designing in Mumbai || Ecommerce website Designing

    ReplyDelete
  4. Thanks for nice post. It is complicated to me now, but in typical, the efficiency and significance is annoying. Very much thanks again and best of luck! Thanks for sharing. Website Maintenance in Mumbai || Website Development || Website Development in Mumbai

    ReplyDelete
  5. Excellent post, I agree with you 100%! I’m always scouring the Internet for new information and learning whatever I can, and in doing so I sometimes leave comments on blogs. Web Designing || Web Designing in Mumbai || Website Maintenance

    ReplyDelete
  6. It was very useful for me. Keep sharing such ideas in the future as well. This was actually what I was looking for, and I am glad to came here! Thanks for sharing the such information with us. CMS Website Design || CMS Website Developer || CMS website development company

    ReplyDelete
  7. This is very informative post to help learners, who want to work in drupal development

    ReplyDelete
  8. This is Awesome Wonderful Information.. Very Nice.. Useful information Thanks.

    ReplyDelete
  9. I found a lot of information here to create this actually best for all newbie here. Thank you for this information.
    Signature:
    Jugar juegos de frozen en línea gratis, los nuevos de princesa de Disney juegos frozen - la princesa encantadora y linda. Divertirse frozen!

    ReplyDelete
  10. Thank you for your post, I look for such article along time, today i find it finally. this post give me lots of advise it is very useful for me
    Signature:
    download free Descargar Whatsapp Para Android and download baixar whatsapp para celular online and descargar whatsapp , baixar whatsapp gratis

    ReplyDelete
  11. Nice Information about the Drupal. Open Source CMS development is one of the most scalable choices for variety of businesses.

    ReplyDelete
  12. Thank you for your post, I look for such article along time, today i find it finally. this post give me lots of advise it is very useful for me
    Signature:
    facebook entrar iniciar sesion gratis - Sitio Oficial iniciado sesión en Facebook lengua española. facebook entrar rápido, facebook iniciar sesion en tu cuenta de entrar facebook

    ReplyDelete
  13. Great info. I love all the posts, I really enjoyed, I would like more information about this, because it is very nice., Thanks for sharing.
    Signature:
    download facebook movel, baixar Facebook movel, baixar facebook. Facebook chat, baixar whatsapp, fazer o download whatsapp baixar para Android, iPhone. Últimas Facebook

    ReplyDelete
  14. This is extremely helpful info!! Very good work. Everything is very interesting to learn and easy to understood. Thank you for giving information.
    Signature:
    Versión en facebook español a los países hablan Español: facebook login entrar , facebook en español para and facebook entrar direto

    ReplyDelete

Post a Comment

Popular posts from this blog

Solved Drupal Interview Questions

A List of the Best Drupal SEO & Social Media Modules