I am working on a project to pull credit reports into our web application using php and xml posting. I have successfully connected, sent and received data and written that data into an xml file. My issue is that the data is within the cdata tag and needs to also be 64bit decoded to produce the pdf file. Anyone have any idea on how I could do this. I'm on php 4.4.4 so some of the newer methods aren't available to me. Any help is much appreciated.
you might need to look at the base64_decode() function, when writing the database to a file, you might need to use the binary flag when you use fopen as well. without more information there isn't much more i can help you with.
I just can't seem to get the data out of the cdata tag, here's the tag <![CDATA[JVBERi0xLjMKJeTjz9IKMSAwIG9iago8PC9UeXBlIC9QYWdlcyAKL0NvdW50IDYgCi9LaWRzIFs0IDAgUiAKMTEgMCBSIAoxNSAwIFIgCjE5AgUiAKMjMgMCBSIAoyNyAwIFIgCl0KPj5l.......NkQ1NjE3MDk1MjFBPjw5QzBDQzM3ODNCRDU0MUFDNDQyOUEzQkNBOTBDRTNENT5dCj4+CnN0YXJ0eHJlZgoxMTYzMgolJUVPRgo=]]> how would I pull the data out of the tag into a variable so I can then use the base64_decode() method to get the pdf data out and displayed. Any suggestions?
I'm trying the following to get the cdata values preg_match_all("/<![CDATA[(.+)]]>/", $data, $string); print_r($string); but I'm getting nothing in the value $string, also tried preg_match_all("/<![CDATA[(.*?)]]>/", $data, $string); print_r($string);
The data within the cdata tag in the xml file is on multiple lines with line breaks on many lines my code is the following $TheData = preg_match_all("/<!\[CDATA\[(.+)\]\]>/s", $data, $string); print_r($string); I get the data but each line in the xml file is on a different line in the variable which causes the pdf to not be created properly due to the line spacing. How can I get the data to stay on one continuous line in the variable?