cmb Posted April 6, 2012 Share Posted April 6, 2012 right now my array is set up so the title of the picture (which is a number) is the key and the keyword or words associated with that picture are the values separated by commas: Array( [1.jpg] => Tyler [10.jpg] => Callum [11.jpg] => Callum [12.jpg] => Adam [13.jpg] => Justin [14.jpg] => Shane [15.jpg] => Callum,Grant [16.jpg] => Justin [17.jpg] => Justin [18.jpg] => Austin [19.jpg] => Jarod [2.jpg] => Tyler [20.jpg] => Austin [21.jpg] => Tyler [22.jpg] => Justin [23.jpg] => Tyler [24.jpg] => Jarod [3.jpg] => Callum [4.jpg] => Shane,Callum [5.jpg] => Adin [6.jpg] => Justin [7.jpg] => Callum [8.jpg] => Adam [9.jpg] => Callum [25.jpg] => Jarod ) im using the galleriffic jquery photo album and in the description area for the picture it shows the keywords in a hyperlink to another page were it shows all the pictures with that keyword but what i want is for when their are multiple keywords i want them to show up as separate hyperlinks Quote Link to comment https://forums.phpfreaks.com/topic/260431-array-spliting/ Share on other sites More sharing options...
Muddy_Funster Posted April 6, 2012 Share Posted April 6, 2012 Sorry, I don't follow Quote Link to comment https://forums.phpfreaks.com/topic/260431-array-spliting/#findComment-1334892 Share on other sites More sharing options...
ted_chou12 Posted April 6, 2012 Share Posted April 6, 2012 I think you should separate your sentence with comma before you try to nest your array with comma. Ted Quote Link to comment https://forums.phpfreaks.com/topic/260431-array-spliting/#findComment-1334897 Share on other sites More sharing options...
cmb Posted April 6, 2012 Author Share Posted April 6, 2012 How can I spilt this part of the array [15.jpg] => Callum,Grant So it looks like this or means the same thing [15.jpg] => Callum [15.jpg] => Grant Quote Link to comment https://forums.phpfreaks.com/topic/260431-array-spliting/#findComment-1334976 Share on other sites More sharing options...
cpd Posted April 6, 2012 Share Posted April 6, 2012 You can't. Array keys must be unique therefore you can only have one 15.jpg. What I suggest you do is have a multidimensional array. [1.jpg] => array([0] => "Callum", [1] => "Grant") [2.jpg] => array([0] => "Something", [1] => "Else", [2] => "Here") Quote Link to comment https://forums.phpfreaks.com/topic/260431-array-spliting/#findComment-1334979 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.