Questions tagged [explode]

explode() is a PHP function that splits a string based on a delimiter, returning an array.

explode() is a PHP function that splits a string based on a delimiter, returning an array.

array explode ( string $delimiter , string $string [, int $limit ] )

Example

$text = "a b c d";
print_r(explode(" ", $text));

gives:

Array ( [0] => a [1] => b [2] => c [3] => d )
2123 questions
3
votes
0 answers

Join on Lateral View Explode Spark1 vs Spark2

If I run the following in spark 1.6 it works fine, but in spark 2.2 I am getting the following error. Anyone know why and how to fix the syntax? sqlContext.sql("SELECT a.* FROM table1 a Lateral View explode(attributes) attributes_table as…
Breandán
  • 1,855
  • 22
  • 34
3
votes
1 answer

SQL-style explode on Dask Series or DataFrame column

I have a Dask Series that contains a column with a list of values. I want to perform a SQL-style explode to create a new row for each index value and corresponding list element. For this particular problem, the lists are all of the same…
marshackVB
  • 43
  • 1
  • 5
3
votes
3 answers

PHP: Text explode() problem

I have a problem with explode() function. I use the function to explode strings like "Name: Replica" but sometimes in the string has 2 or more colons ( ":" ) and there is the problem because my script is: Example: "Name:…
user546774
3
votes
2 answers

Explode string together with tags in between [PHP]

I have the following sample string: $string = 'I wish you a merry Christmas and a happy new year!' Now I am trying to explode this string so that the output is: $arr[0] =…
Mango D
  • 501
  • 3
  • 11
  • 28
3
votes
3 answers

Array operations (addition of arrays) in hive

I have a hive table with columns id(String),val(String) as : id,val abc,{0|1|0} abc,{0|1|1} abc,{1|0|1|1} I want to add the val column grouping by id column. Expected result is : id,val abc,{1|2|2|1} This result would be got by adding the arrays…
Pooja Nayak
  • 182
  • 1
  • 4
  • 11
3
votes
5 answers

PHP: Change only a portion of a URL string?

I’m working on a small hoppy project where I want to replace a specific page on a URL. Let me explain: I’ve got the URL http://www.example.com/article/paragraph/low/ I want to keep the URL but replace the last segment /low/ with /high/ so the new…
Emil Devantie Brockdorff
  • 4,724
  • 12
  • 59
  • 76
3
votes
3 answers

How to remove exploded war in JBoss without stopping the server?

I can delete everything except lib folder(JBoss says application is undeployed, but he wont release the jars). I tied jboss-maven-plugin and hard-undeploy, however it says that file(doc says it also support dirs) is undeployed, however it does not…
IAdapter
  • 62,595
  • 73
  • 179
  • 242
3
votes
3 answers

How can I use a condition in explode() function?

Here is my code: $str = "this is a test" $arr = explode(' ', $str); /* output: array ( 0 => "this", 1 => "is", 2 => a, 3 => test ) All I'm trying to do is adding this condition to the explode() function: if the word of a is…
stack
  • 10,280
  • 19
  • 65
  • 117
3
votes
5 answers

How to extract a single letter or number from a string?

I need to extract a specific letter or number from string.