explode Questions

9

Solved

is there a way to get the n-th element of a splitted string without using a variable? My PHP code always looks like this: $foo = explode(" ", "bla ble bli"); echo $foo[0]; Is there a shorter wa...
Lafave asked 30/3, 2011 at 20:22

1

Solved

I am trying to explode a string on what looks like to be a null character. This is what is what I am using: $exp = explode('\x00', $bin);. Though this does not work. However, if I do $exp = exp...
Kamp asked 22/3, 2011 at 9:43

2

Solved

I need to explode my string input into an array at the commas. However the string contains commas inside quotes. Input: $line = 'TRUE','59','A large number is 10,000'; $linearray = explode...
Mirna asked 27/2, 2011 at 10:0

5

Solved

$variable = 'one, two, three'; How can I replace the commas between words with <br>? $variable should become: one<br> two<br> three
Barcus asked 17/9, 2010 at 13:25

5

Solved

What's the best way to accomplish the following. I have strings in this format: $s1 = "name1|type1"; //(pipe is the separator) $s2 = "name2|type2"; $s3 = "name3"; //(in some of them type can be ...
Elizabethelizabethan asked 19/5, 2010 at 16:7

1

Solved

I'm working on a long string grabbed from a Session that uses "§" (Section sign) to group and divide different parts of the string. Example: "ArticleID | Title | Date § ArticleID | Title | Date § ...
Veratrine asked 3/9, 2009 at 2:52

© 2022 - 2024 — McMap. All rights reserved.