callingrohit Posted January 1, 2007 Share Posted January 1, 2007 Hi everyone,I have a form with checkbox input and the data is stored into a MYSQL table. So I serialize this checkbox data before inserting it into the database. Now I also export the data with a click of a button into a spreadsheet. The data in the mysql table looks like this [b]a:3:{i:0;s:3:"uno";i:1;s:3:"dos";i:2;s:4:"tres";}[/b]I was wondering if its possible to modify the above data to just [b]uno,dos,tres[/b] and then insert it into my excel table.Thankscheersrohit Link to comment https://forums.phpfreaks.com/topic/32435-how-to-seperate-data-serialized-and-input-into-mysql/ Share on other sites More sharing options...
trq Posted January 1, 2007 Share Posted January 1, 2007 Not very pretty but...[code]#!/usr/bin/php<?php $line = 'a:3:{i:0;s:3:"uno";i:1;s:3:"dos";i:2;s:4:"tres";}'; $arr = explode('"',$line); $newstring = $arr[1].','.$arr[3].','.$arr[5]; echo $newstring;?>[/code] Link to comment https://forums.phpfreaks.com/topic/32435-how-to-seperate-data-serialized-and-input-into-mysql/#findComment-150709 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.