I have this bit of code in my script that creates a link to a PDF.
$pdf_filename = $row["outgoing_pdf"];
$pdf_url = rtrim( "http://45.63.20.147/p3/" ) . $pdf_filename;
$pdf_meta = array( $outgoing_pdf , $pdf_url );
Then it inserts the PDF using this:
update_post_meta( $post_id , "ptb_outgoing_pdf" , $pdf_meta );
However, in my database, I am getting this
a:2:{i:0;N;i:1;s:67:"http://45.63.20.147/p3/pdf/responses/76699168_ROA20100603173238.pdf";}
I have been reading for weeks on how to get just the URL from that, but cannot figure it out. I appreciate any help in advance.
a:2:{i:0;N;i:1;s:67:"http://45.63.20.147/p3/pdf/responses/76699168_ROA20100603173238.pdf";}
This is serialized value by serialize()
function. Use unserialize()
function to restore original value.
Example - http://ideone.com/zwrO9s
This was the solution.
$pdf_filename = $row["outgoing_pdf"];
$pdf_url = rtrim( "http://45.63.20.147/p3/" ) . $pdf_filename;
$pdf_meta = $pdf_url;