I have used this function to create a string called $headers:
function GetHeaders($fil e_name){
return "<th><a href='".$file_n ame."&order_by= l_e'>L_E</a></th>
<th><a href='".$file_n ame."&order_by= carnumber'>Carn umber</a></th>
<th><a href='".$file_n ame."&order_by= location'>Locat ion</a></th>
<th><a href='".$file_n ame."&order_by= sighting_date_a sc'>Sighting
Date</a></th>
<th><a href='".$file_n ame."&order_by= classification' >Code</a></th>
<th><a href='".$file_n ame."&order_by= railroad'>RR</a></th>
<th><a href='".$file_n ame."order_by=o rigin'>Origin</a></th>
<th><a href='".$file_n ame."&order_by= destination'>De stination</a></
th>
<th width='15%'><a href='".$file_n ame."'>ETA</a></th>";
}
Now I want to unpack the $header array and create two strings,
called s1 and s2. I want s1 to be field names for excel and s2 to
be the column names. For example l_e is the field name and L_E is
capitalized to be the column header in Excel. In other words, I want
is the two fields after the order_by= without the 'and the </a>.
How to use unpack?
s1=unpack($head ers/37, 9, $data)
I don't know how to use unpack but I have the $header array as the
string, I counted 37 characters to the word order_by and the word
order_by= is 9 characters I want to grab that word before the '.
How do I make use of the unpack function to get what I want?
tia,
function GetHeaders($fil e_name){
return "<th><a href='".$file_n ame."&order_by= l_e'>L_E</a></th>
<th><a href='".$file_n ame."&order_by= carnumber'>Carn umber</a></th>
<th><a href='".$file_n ame."&order_by= location'>Locat ion</a></th>
<th><a href='".$file_n ame."&order_by= sighting_date_a sc'>Sighting
Date</a></th>
<th><a href='".$file_n ame."&order_by= classification' >Code</a></th>
<th><a href='".$file_n ame."&order_by= railroad'>RR</a></th>
<th><a href='".$file_n ame."order_by=o rigin'>Origin</a></th>
<th><a href='".$file_n ame."&order_by= destination'>De stination</a></
th>
<th width='15%'><a href='".$file_n ame."'>ETA</a></th>";
}
Now I want to unpack the $header array and create two strings,
called s1 and s2. I want s1 to be field names for excel and s2 to
be the column names. For example l_e is the field name and L_E is
capitalized to be the column header in Excel. In other words, I want
is the two fields after the order_by= without the 'and the </a>.
How to use unpack?
s1=unpack($head ers/37, 9, $data)
I don't know how to use unpack but I have the $header array as the
string, I counted 37 characters to the word order_by and the word
order_by= is 9 characters I want to grab that word before the '.
How do I make use of the unpack function to get what I want?
tia,
Comment