Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

explode

Explode string by one or more spaces or tabs

November 15, 2022 by Tarik

$parts = preg_split(‘/\s+/’, $str);

Categories php Tags explode, php, regex Leave a comment

Php multiple delimiters in explode [duplicate]

October 22, 2022 by Tarik

Try about using: $output = preg_split(‘/ (@|vs) /’, $input);

Categories php Tags explode, php Leave a comment

Explode string on commas and trim potential spaces from each value

October 13, 2022 by Tarik

You can do the following using array_map: $new_arr = array_map(‘trim’, explode(‘,’, $str));

Categories php Tags explode, higher-order-functions, php, preg-split, trim Leave a comment

Convert a comma-delimited string into array of integers?

September 30, 2022 by Tarik

You can achieve this by following code, $integerIDs = array_map(‘intval’, explode(‘,’, $string));

Categories php Tags arrays, explode, integer, php, string Leave a comment

Split a comma-delimited string into an array?

September 27, 2022 by Tarik

Try explode: $myString = “9,admin@example.com,8”; $myArray = explode(‘,’, $myString); print_r($myArray); Output : Array ( [0] => 9 [1] => admin@example.com [2] => 8 )

Categories php Tags arrays, csv, explode, php, string Leave a comment
Newer posts
← Previous Page1 Page2

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa