Tag Archives: array

Using implode() to Convert an Array to a String

If you’ve read the last two articles, you know how the explode() function works. The implode() function does just the opposite. It converts an array to a delimiter-separated string. In …

Tags: , , , | Posted under MODX, MODX | Leave a comment

Using explode() to create arrays

Say you have a snippet that needs a simple array and want to send the elements of the array in the snippet tag. The PHP explode() function is custom-made for …

Tags: , , | Posted under MODX, MODX | Leave a comment

Replacing Strings with an Associative Array (PHP)

In the previous article, we looked at using str_replace with two separate arrays, one for the strings to replace, and one for the replacements. This isn’t always the most convenient …

Tags: , , , , | Posted under MODX, MODX | Leave a comment