Loganathan Natarajan
asked on
How can I split the array as 4 rows per line?
I have comma separated values as beblow in array
$array="IAM-00001-04684.jp g,IAM-0000 1-04685.jp g,IAM-0000 1-04686.jp g,IAM-0000 1-04687.jp g,IAM-0000 2-04688.jp g,IAM-0000 2-04689.jp g,IAM-0000 2-04690.jp g,IAM-0000 2-04691.jp g,IAM-0000 3-04692.jp g,IAM-0000 3-04693.jp g,IAM-0000 3-04694.jp g,IAM-0000 3-04695.jp g,IAM-0000 4-04696.jp g,IAM-0000 4-04697.jp g,IAM-0000 4-04698.jp g,IAM-0000 4-04699.jp g,IAM-0000 5-04700.jp g,IAM-0000 5-04701.jp g,IAM-0000 5-04702.jp g,IAM-0000 5-04703.jp g";
I want to split & print on the page the above as below (just in a row 4 each like), if possible remove end "," on the 4th value
IAM-00001-04684.jpg,IAM-00 001-04685. jpg,IAM-00 001-04686. jpg,IAM-00 001-04687. jpg
IAM-00002-04688.jpg,IAM-00 002-04689. jpg,IAM-00 002-04690. jpg,IAM-00 002-04691. jpg
IAM-00003-04692.jpg,IAM-00 003-04693. jpg,IAM-00 003-04694. jpg,IAM-00 003-04695. jpg
IAM-00004-04696.jpg,IAM-00 004-04697. jpg,IAM-00 004-04698. jpg,IAM-00 004-04699. jpg
IAM-00005-04700.jpg,IAM-00 005-04701. jpg,IAM-00 005-04702. jpg,IAM-00 005-04703. jpg
Please help.
Thanks
$array="IAM-00001-04684.jp
I want to split & print on the page the above as below (just in a row 4 each like), if possible remove end "," on the 4th value
IAM-00001-04684.jpg,IAM-00
IAM-00002-04688.jpg,IAM-00
IAM-00003-04692.jpg,IAM-00
IAM-00004-04696.jpg,IAM-00
IAM-00005-04700.jpg,IAM-00
Please help.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@Chris: Yes, there are really a lot of PHP functions for dealing with arrays. I counted 79, which is more than the count of all of the instructions in the first programming language I learned!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks to all