Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9253033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:06:47+00:00 2026-06-18T11:06:47+00:00

I am using this php to parse the data and iterate over the rows

  • 0

I am using this php to parse the data and iterate over the rows but the configuration of commas and double quotes has me super confused.

Any help would be greatly appreciated.

This code I am using is breaking strings that contain commas in them.

$getDataExploded = array();
$out = "";
foreach($getData as $getDataRows)
{
    $getDataExploded = explode(",",$getDataRows);
        $out .= '<div id="'.$getDataExploded[4].'" class="row"><span style="font-size:14px; color:#646464;">'.$getDataExploded[0].'</span><br><span style="font-size:12px; color:#3877D9;">'.$getDataExploded[1].' / '.$getDataExploded[2].'<br><em style="font-size:11px; color:#757575;">Posted: '.$getDataExploded[3].'</em></span></div>';


}

echo($out);

Here is what the array I am trying to parse looks like…

array(29) { [0]=> string(62) “‘wefwefwef’,’ewfwefwefwef’,’wefwefwef’,1/29/2013 9:09:04 PM,37” [1]=> string(47) “‘wefwef’,’wefwefwef’,”,1/29/2013 9:08:11 PM,36″ [2]=> string(82) “‘Job Like You Never Knew’,’Sandy Hurricanes’,’Boise Idaho’,1/29/2013 9:06:12 PM,35” [3]=> string(32) “”,”,”,1/29/2013 9:04:10 PM,34″ [4]=> string(49) “‘wefwefwef’,’wfwefwef’,”,1/29/2013 9:02:05 PM,33″ [5]=> string(82) “‘Sheriff Recruitment’,’Sheriff Recruitment’,’Rhode Island’,1/28/2013 7:13:53 PM,25” [6]=> string(81) “‘Neighborhood Sales Representatives’,’Trugreen’,’Warwick’,1/28/2013 7:13:53 PM,24” [7]=> string(86) “‘Police Officer Recruitment’,’The City of Cranston’,’Cranston’,1/28/2013 7:13:53 PM,23” [8]=> string(144) “‘RNs, LPNs, CNAs, Nurse Practitioners and Physician Assistants Recruitment’,’Adil Business Systems, Inc.’,’Rhode Island’,1/28/2013 7:13:53 PM,22” [9]=> string(79) “‘Econotel EBS’,’Telecommunications Installer’,’Rumford’,1/28/2013 7:13:53 PM,21” [10]=> string(73) “‘Full-Charge Bookkeeper’,’Econotel EBS’,’Rumford’,1/28/2013 7:13:53 PM,20” [11]=> string(127) “‘Certified Nursing Assistants’,’Morning Star Home Care’,’Wakefield, Westerly, Newport and Narragansett’,1/28/2013 7:13:53 PM,19” [12]=> string(78) “‘Automobile Accountant’,’Colonial Toyota’,’Smithfield’,1/28/2013 7:13:53 PM,18” [13]=> string(89) “‘Certified Nursing Assistants’,’All About Home Care’,’Middletown’,1/28/2013 7:13:53 PM,17” [14]=> string(97) “‘Customer Development/Inside Sales’,’Hexagon Metrology’,’North Kingstown’,1/28/2013 7:13:53 PM,16” [15]=> string(85) “‘RI Sheriff’,’The RI Department of Public Safety’,’statewide’,1/28/2013 7:13:53 PM,15” [16]=> string(89) “‘Certified Nursing Assistants’,’Morning Star Home Care’,’Warwick’,1/28/2013 7:13:53 PM,14” [17]=> string(95) “‘Entry-Level Software Developers’,’Hexagon Metrology’,’North Kingstown’,1/28/2013 7:13:53 PM,13” [18]=> string(83) “‘Electronics Technician’,’Purvis Systems Inc.’,’Middletown’,1/28/2013 7:13:53 PM,12” [19]=> string(81) “‘Nurse Practitioner’,’Memorial Hospital’,’Plainville, MA’,1/28/2013 7:13:53 PM,11” [20]=> string(86) “‘Home Care Physical Therapist’,’Memorial Hospital’,’Pawtucket’,1/28/2013 7:13:53 PM,10” [21]=> string(87) “‘Real Estate Specialist’,’Linear Title and Closing’,’Middletown’,1/28/2013 7:13:53 PM,9” [22]=> string(77) “‘Equipment Technician’,’Angelica Textiles’,’Pawtucket’,1/28/2013 7:13:53 PM,8” [23]=> string(68) “‘Painting Crew Leader’,’LOPCO’,’Rhode Island’,1/28/2013 7:13:53 PM,7” [24]=> string(102) “‘Diesel Mechanic’,’Interstate Diesel Equipment Service, Inc.’,’North Kingstown’,1/28/2013 7:13:53 PM,6” [25]=> string(73) “‘Hydromat Machine Operators’,’Greystone’,’Lincoln’,1/28/2013 7:13:53 PM,5” [26]=> string(85) “‘National Sales Manager’,’Hexagon Metrology’,’North Kingstown’,1/28/2013 7:13:53 PM,4” [27]=> string(131) “‘North Providence Probationary Police Officer Recruitment’,’The Town of North Providence’,’North Providence’,1/28/2013 7:13:53 PM,3” [28]=> string(113) “‘Territory Service Representatives’,’Scotts Lawn Service’,’Rhode Island and Massachusetts’,1/28/2013 7:13:53 PM,2” }

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:06:48+00:00Added an answer on June 18, 2026 at 11:06 am

    PHP provides a str_getcsv() method which you may find useful. It stops you needing to worry as much about commas and text delimiters.

    $getDataExploded = array();
    $out = "";
    foreach($getData as $getDataRows)
    {
        $getDataExploded = str_getcsv($getDataRows);
        //Do out stuff here `htmlentities` as required
    
    }
    
    echo($out);
    

    Edit: Changed use of htmlentities as pointed out by jeroen

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PHP xmlreader to validate and parse xml data. This xml is validated
I'm trying to parse an xml file with PHP. I'm using this code and
I know how to do this using PHP, but I was wondering if MySQL
I am using the excellent Parse as a data store, but need to access
I am using PHP/Regex to parse some data for an application. The pages I
I am using JSON to parse data and connect to a PHP file. I
Im using this PHP to get a list of Title's from an RSS feed:
I'm using this PHP framework for use with Shopify's API Can anyone help me
I am using this PHP code: if (isset($_GET['c'])) { $pages = array(home, upload, signup);
I'm using this php class ( http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php ) for creating the different sized images

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.