This is how I explode a sentence into an array of words:
$words = explode(" ", $sentence)
;
How do you do the opposite? (take an array such as $words
with single numeric keys into a variable storing a string such as $sentence
with spaces between words)
Hi, the command you are looking for is "join", it will connect all the lines you select. To execute this command you need to turn all the lines you want to join into polylines if they aren't already. 1) select line 2) type "pedit" 3) press enter.
The explode() function breaks a string into an array, but the implode function returns a string from the elements of an array.
The implode() function returns a string from the elements of an array. Note: The implode() function accept its parameters in either order. However, for consistency with explode(), you should use the documented order of arguments. Note: The separator parameter of implode() is optional.
The explode() function splits a string based on a string delimiter, i.e. it splits the string wherever the delimiter character occurs. This functions returns an array containing the strings formed by splitting the original string.
http://php.net/manual/en/function.implode.php
$sentence = implode(' ',$words);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With