PHP - Need Help In Parsing Htm Documents
Similar TutorialsHey Everyone, I need to have the ability to create PDF/X1A documents. My initial thoughts are it would be easy as i have created PDFs in the past with no hassle. I have been trawling the google and various blogs but with no joy. Does anyone have any experience creating PDF/X1A documents in PHP ? Is it possible ? Regards, -Ben is there a way I can make something like a ticket in pdf format that can have $name or the likes echo in it? if you could help get me started, that would be great! Hi, There is this project 'District Collector Office-Information integration' that computerizes the citizen facility center. In the system citizens can apply for birth certificates,marriage certificate , obtain ration cards among other functionalists online.so far my system can generate birth and marriage certificates but i totally have no idea on how to validate the same.at what conditions is one illegible to obtain a marriage cert?,supposing one has more than one wife?,what limits one from applying for more than one document? when is one illegible to obtain a birth cert.? conditions limiting application of more than one birth cert ? Thanx. Regards cornelius I am trying to write to a document that is open doc format. Are there any libraries that help out with this specifically mailing labels? Hi, I've been looking around the net and various forums and found that the code below does appear to work and do what I need at a basic level, but I was wondering if there was a quick and easy way to improve this code OR another alternative that would give me similar/better results. I effectively have certain word documents that I want to use as templates for part of a project. So if i were to write a letter I could pull from the DB usual name/address, but also other intelligent information that might be dependant on different DB fields so it could generate different options, ie if they had children it would produce a different sentence?? Obviously my ideal solution would be that the php coding wouldnt need to be touched, but would allow for 'coded options' within the document to be added/removed without causing any issues, maybe some kind of generic coding so at least some content can be re-used for multiple documents ? However, I did have two initial thoughts on how to do some of this - maybe? (be gentle im still a learner!) 1, create an array of somekind and use generic terms for a set range, say 'bookmark1','bookmark2', etc so a user could just tag the original word document knowing they only had to add a new number to the end if they needed to add something new ? 2,read the document contents out -DO STUFF TO IT- load it back into a doc/save. with this method I will have to admit ive not done before so would welcome any extra detailed input or advisory suggestions, ie. ensuring it goes back into the correct format, say there was an image/logo or complicated series or bulleted paragraghs or tables ?? I have initially choosen MS word as many people out there are familiar with this product and is widely used. However, if it means I am able to create something easily and better within some other format or package that will give me what I want but also be compatible with word then im more than happy to go with any suggestions (ie templates initially created within openoffice and merely saved into .DOC format?) <?php //1. Instanciate Word $word = new COM("word.application") or die("Unable to instantiate Word"); //2. specify the MS Word template document (with Bookmark TODAYDATE inside) $template_file = "C:/t.doc"; //3. open the template document $word->Documents->Open($template_file); //4. get the current date MM/DD/YYYY $current_date = date("m/d/Y"); //5. get the bookmark and create a new MS Word Range (to enable text substitution) $bookmarkname = "mytester"; $objBookmark = $word->ActiveDocument->Bookmarks($bookmarkname); $range = $objBookmark->Range; //6. now substitute the bookmark with actual value $range->Text = $current_date; //7. save the template as a new document (c:/reminder_new.doc) $new_file = "c:/reminder_new.doc"; $word->Documents[1]->SaveAs($new_file); //8. free the object $word->Quit(); //$word->Release(); $word = null; ?> Hi everyone, I do not know if this is the right place to ask the following, but I know all the php guru's read here. So please take a moment to read and please help point me in the right direction. I have a php website that I am developing, it is a job website, where my problem is that I need to be able to extract text from the following file formats: doc, docx, rtf, txt and maybe pdf. I have googled and done research on this subject, but I do not find any php scripts that can do the job properly. I have found a java app developed by apache that does the text extraction perfectly, called apache tika. (calling it using exec is really a problem, since most hosts don't provide root access.) I need a way to use this with php. If you know of any other method that I can do this, please help and suggest as this is a major bridge that I have to cross very urgently. your help will be much appreciated, thanks Hi, Well I have been working on Php for quite sometime but creating Word Docs is something I am totally new to. I googled about this and found different methods of creating word documents via php. The most promising one that I found involves writing HTML code and inside header, save it as a *.doc file (I know thats not exactly a Word File but what else can be done). Like this, Code: [Select] header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment; Filename=Report.doc"); The whole word document came out perfectly fine, but there was one little problem (later on turned out to be the BIGGEST one) was placing images in the document. All the images were saved on a secure server so like we do in HTML, I used the following line of code, <img src="https://somewebaddress/users.png" /> The word document appeared to be fine for me, but when that document was sent to the client, client was unable to view the images. Now, I guess you all know what my question would be, and that is, is there a way we could somehow make this work. I even tried downloading all the images to disk and giving their path, still in the end, the document only needs to be sent to the client and images do not appear. Please help me in this regards, Thanks in advance to all P.S. Please see the following sample (mini) code of the real thing, real document is a bit toooooooo big and kind of confidential Code: [Select] <?php header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment; Filename=Report.doc"); ?> <html> <head> <title>TCS Monthly Report $month $year</title> </head> <body> <b><h3> Monthly Operational User Statistics</h3></b> <br> The red line is users logged in over the month. The green area is users recently logged in (last few days).<br> <br><img src="https://somewebaddress/users.png" /> </body> </html> I'm storing website files online and each user can upload their own files and admin can upload files for that user specifically. How would I go about making sure nobody else can download their PDF file? Would it be a case of assigning a folder for each user's documents and not allowing access to any other user to that folder?
Thanks in advance.
hello dear folks good evening dear PHP-Freaks,
well i am not sure if this question fits here - in miscellaneous.
but i am pretty sure that many many calc and excel-experts are here in this great forum.
what is aimed:
want to create a calendar - with 365-chunks that are imported into a caleandar form see some ideas where i can import this i posted the example-calc spreassheet that i want to import. note it has got 365 lines - for 365 days of the next year 2015 what needs to be done ; whats needs to be achieved: i need to impoort the example into the calendar form. see some of the examples -.. if i am able to import the texts (of the collumn ) in a writer or word document each line of the calc needs to get on a sheed of the word or writer. i need to know how to arrange this export of calc into the writer document. if i need to explain it more thoroughiy - just let me know! greetings you matze see some examples of calendar templates Blank daily calendar - Templates Daily lesson planner (color, landscape) - Templates note: all i need to know is to be able to export from calc to any word or calc document... see the attached sample below... Attached Files 2015_sample_version_.ods.zip 18.07KB 0 downloads Hello one and all, Just a quick request here, I've written a script that sends an email with an attached file by the user. (docx, txt, pdf, doc, rtf) are the formats I have accepted. At the moment I'm sending them with the following... Code: [Select] $fileatt_type = "application/pdf"; // File Type It works fine with all formats in older email clients, i.e, like yahoo before they updated the layout, but in the newer versions it's specific and if I try to send it this way it is always delivered as a .PDF and doesn't open if it is any of the other formats. It may sound silly but I've searched a fair bit for the other extensions or formats to include instead of the above code (maybe something like application/doc or something) but there doesn't seem to be a list. Can anyone point me in the right direction? Much obliged, PHP the learned. Hello, First post here! I am using a script to store small files into a database. I know it is not highly recommended but this is the only solution I can find in this case. All seems fine when inserting but when retrieving all documents are corrupt. I am working with PHP 5 on Windows server. Part script after upload: (the document is uploaded to the server first and this is working fine) Code: [Select] if (!empty($_FILES)) { $folder = "kenya/docs_temp/";//including last / $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = dirname(__FILE__); $targetPath = substr($targetPath,0,strrpos($targetPath, "uploadify")). $folder; $targetFile = str_replace('\\','/',$targetPath) . $_FILES['Filedata']['name']; $fileName = $_FILES['Filedata']['name']; $tmpName = $_FILES['Filedata']['tmp_name']; $fileSize = $_FILES['Filedata']['size']; $fileType = $_FILES['Filedata']['type']; $conn=odbc_connect('xxx','xxx','xxxx'); $content = file_get_contents($tmpName,true); $content = addslashes($content); if(!get_magic_quotes_gpc()){ $fileName = mysql_real_escape_string($fileName); } $file_info = pathinfo($_FILES['Filedata']['name']); $addDoc = "INSERT INTO tblfiles (file_name,file_type,file_size,file_content,file_extension) VALUES ('".addslashes($fileName)."','".$fileType."','".$fileSize."','".$content."','".$file_info['extension']."')"; odbc_exec($conn,$addDoc); } The the script to retrieve and output to the browser: Code: [Select] $conn=odbc_connect('xxxx','xxx','xxxx'); //get the document $getF = "SELECT * FROM tblfiles WHERE userId = '".$_GET['userId']."' AND fileId = '".$_GET['fileId']."'"; $rsF = odbc_exec($conn,$getF); $size = floor(odbc_result($rsF,'file_size')); $type = odbc_result($rsF,'file_type'); $name = odbc_result($rsF,'file_name'); $content = odbc_result($rsF,'file_content'); ob_end_clean(); header("Content-length: ".$size.""); header("Content-type: ".$type.""); header('Content-Disposition: attachment; filename="'.$name.'"'); echo $content; And finally here is the structure for the table: Code: [Select] CREATE TABLE `tblfiles` ( `fileId` int(11) NOT NULL auto_increment, `userId` int(11) NOT NULL, `file_name` varchar(100) NOT NULL, `file_type` varchar(100) default NULL, `file_size` int(11) default NULL, `file_content` mediumblob, `file_extension` varchar(50) NOT NULL, PRIMARY KEY (`fileId`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; many thanks for any assistance. Basically I'm reading a local xml file, extracting data, and passing array over to a MySql function. Also, when each record is extracted I need to know the full parent-child category it was listed under. for example: <root> <node value="first"/> <node value="second"/> <header label="Numbers"> <header label="Roman numerals"> <node value="I"/> <node value="XV"/> </header> <node value="1"/> <node value="10"/> </header> </root> How can I access the id part? <EXM id="1233456"><products>...</products></EXM> Hello, I have an xml file below with multiple namespaces called "date". I want to know how to echo out each date that is associated with that "item" if that makes sense. Thanks Code: [Select] <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <item> <title>My Title</title> <dc:date>2009-02-12</dc:date> <dc:date>2010-09-01</dc:date> </item> </channel> </rss> Hello to all Can someone help me on how can i parse this XML string? Code: [Select] <?php <?xml version="1.0" encoding="UTF-8"?><SendSMSResponse><Transaction><IP>120.28.199.73</IP><Code>1</Code><Description>Transaction OK</Description></Transaction><Destinations><Destination><Number> +639217195804 </Number><Code>1</Code></Destination></Destinations></SendSMSResponse> ?> I would like to get the word "Transaction OK" but i dont know where to start. thanks in advance Hi guys I am new to this forum and a complete newb to php. I was wandering if I can get some help with XML parsing using php. The XML snippet is as follows:-- <some-xml1> <some-xml2> </some-xml2> <ReportHost> <HostName>192.168.2.34</HostName> <startTime>Thu Dec 17 13:58:49 2007</startTime> <stopTime>Thu Dec 17 15:13:13 2007</stopTime> <netbios_name>(unknown)</netbios_name> <mac_addr>(unknown)</mac_addr> <dns_name>(unknown)</dns_name> <os_name>(unknown)</os_name> <num_ports>2</num_ports> <num_lo>0</num_lo> <num_med>0</num_med> <num_hi>0</num_hi> <ReportItem> <port>http (80/tcp)</port> <severity>0</severity> <pluginID>0</pluginID> <pluginName></pluginName> <data>PORT</data> </ReportItem> <ReportItem> <port>telnet (23/tcp)</port> <severity>0</severity> <pluginID>0</pluginID> <pluginName></pluginName> <data>PORT</data> </ReportItem> <ReportItem> <port>http (80/tcp)</port> <severity>0</severity> <pluginID>0</pluginID> <pluginName></pluginName> <data>PORT</data> </ReportItem> <ReportItem> <port>telnet (23/tcp)</port> <severity>0</severity> <pluginID>0</pluginID> <pluginName></pluginName> <data>PORT</data> </ReportItem> </ReportHost> <some-xml3> </some-xml3> </some-xml1> There are <reporthost> tags for one host and within that tag are <reportitem> tags for every item on that host. Now I need a way to extract hostnames from every <reporthost> and associate all the <pluginname> with that particular host. Any help will be appreciated. Thanks in advance what is wrong with this code? I want to parse rss content and its giving error that, the input is not corret $xmlDoc = new DOMDocument(); $xml="http://www.pharmamanufacturing.com/index.html?mode=rss"; $xmlDoc->loadxml($xml); //$xmlDoc->load($xml); Ok there is more than one <land> on that xml. I need to parse out the name and cost and id of each land ... how can I do this? here is some of the xml Notice that there is more than one <land> entry, I need to parse out each land and have it assigned to a certain variable . thanks Code: [Select] <outer> − <xml> − <undeveloped_lands> − <land> <id>200</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fpawn%5Fshop%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Pawn%20Shop%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24200%2C000%3C%2Fspan%3E%3Cbr%3E </details> <num_owned>0</num_owned> <cost>1000000000</cost> <is_racket>true</is_racket> <favor_points>0</favor_points> <purchase_limit>5</purchase_limit> <name>Pawn%20Shop</name> <income>$200,000</income> − <enhancements> − <enhancement> <value>1</value> − <suffix> % chance of a spirited defense (1/2x damage) when attacked </suffix> <prefix>+</prefix> <type>ATTACK_CRITICAL_DEFENSE_PERCENT</type> </enhancement> </enhancements> </land> − <land> <id>0</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fempty%5Flot%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Vacant%20Lot%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24100%3C%2Fspan%3E%3Cbr%3E </details> <num_owned>0</num_owned> <is_racket/> <cost>4500</cost> <favor_points>0</favor_points> <name>Vacant%20Lot</name> <income>$100</income> </land> − <land> <id>1</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fempty%5Fstorefront%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Empty%20Storefront%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24300%3C%2Fspan%3E%3Cbr%3E </details> <num_owned>0</num_owned> <is_racket/> <cost>45000</cost> <favor_points>0</favor_points> <name>Empty%20Storefront</name> <income>$300</income> </land> − <land> <id>201</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fscrap%5Fyard%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Scrap%20Yard%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24200%2C000%3C%2Fspan%3E%3Cbr%3E </details> <num_owned>0</num_owned> <cost>1000000000</cost> <is_racket>true</is_racket> <favor_points>0</favor_points> <purchase_limit>5</purchase_limit> <name>Scrap%20Yard</name> <income>$200,000</income> − <enhancements> − <enhancement> <value>1</value> <suffix>% chance of critical hits in fights</suffix> <prefix>+</prefix> <type>ATTACK_CRITICAL_HIT_PERCENT</type> </enhancement> </enhancements> </land> − <land> <id>2</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fplaza%5Fv2%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Plaza%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%242%2C000%3C%2Fspan%3E%3Cbr%3E </details> <num_owned>0</num_owned> <is_racket/> <cost>900000</cost> <favor_points>0</favor_points> <name>Plaza</name> <income>$2,000</income> </land> − <land> <id>9</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fbeach%5Flot%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Seaside%20Lot%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%248%2C000%3C%2Fspan%3E%3Cbr%3E </details> <num_owned>0</num_owned> <is_racket/> <cost>3500000</cost> <favor_points>0</favor_points> <name>Seaside%20Lot</name> <income>$8,000</income> </land> − <land> <id>14</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fempty%5Ffield%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Empty%20Field%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24100%2C000%3C%2Fspan%3E%3Cbr%3E </details> <num_owned>0</num_owned> <is_racket/> <cost>75000000</cost> <favor_points>0</favor_points> <name>Empty%20Field</name> <income>$100,000</income> </land> − <land> <id>23</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Foverseas%5Flot%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Overseas%20Lot%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%2450%2C000%3C%2Fspan%3E%3Cbr%3E </details> <num_owned>0</num_owned> <is_racket/> <cost>50000000</cost> <favor_points>0</favor_points> <name>Overseas%20Lot</name> <income>$50,000</income> </land> </undeveloped_lands> − <establishments> − <land> <id>24</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fundersea%5Fsmuggling%5Fstation%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Undersea%20Smuggling%20Station%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24100%2C000%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Seaside%20Lot%3C%2Fspan%3E </details> <num_owned>40</num_owned> <cost>200000000000</cost> <is_racket>false</is_racket> <favor_points>0</favor_points> <name>Undersea%20Smuggling%20Station</name> <income>$100,000,000</income> <built_on>Seaside%20Lot</built_on> <enhancements/> </land> − <land> <id>17</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fnewsstand%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Newsstand%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24100%3C%2Fspan%3E%3Cbr%3E </details> <num_owned>5410</num_owned> <is_racket/> <cost>813000</cost> <favor_points>0</favor_points> <name>Newsstand</name> <income>$100</income> </land> − <land> <id>3</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Ftownhomes%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Townhomes%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24300%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Vacant%20Lot%3C%2Fspan%3E </details> <num_owned>2610</num_owned> <is_racket/> <cost>2358000</cost> <favor_points>0</favor_points> <name>Townhomes</name> <income>$300</income> <built_on>Vacant%20Lot</built_on> </land> − <land> <id>4</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fresturant%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Ristorante%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24700%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Vacant%20Lot%3C%2Fspan%3E </details> <num_owned>2180</num_owned> <is_racket/> <cost>5475000</cost> <favor_points>0</favor_points> <name>Ristorante</name> <income>$700</income> <built_on>Vacant%20Lot</built_on> </land> − <land> <id>5</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fcondos%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Condo%20Complex%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%245%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Empty%20Storefront%3C%2Fspan%3E </details> <num_owned>2430</num_owned> <is_racket/> <cost>39040000</cost> <favor_points>0</favor_points> <name>Condo%20Complex</name> <income>$5,000</income> <built_on>Empty%20Storefront</built_on> </land> − <land> <id>6</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fhotel%5Fv3%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Luxury%20Hotel%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%2410%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Empty%20Storefront%3C%2Fspan%3E </details> <num_owned>2210</num_owned> <is_racket/> <cost>77700000</cost> <favor_points>0</favor_points> <name>Luxury%20Hotel</name> <income>$10,000</income> <built_on>Empty%20Storefront</built_on> </land> − <land> <id>18</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Foffice%5Fbuilding%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Office%20Building%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%2420%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Vacant%20Lot%3C%2Fspan%3E </details> <num_owned>1290</num_owned> <is_racket/> <cost>156000000</cost> <favor_points>0</favor_points> <name>Office%20Building</name> <income>$20,000</income> <built_on>Vacant%20Lot</built_on> </land> − <land> <id>7</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fsky%5Fscraper%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Skyscraper%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24170%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Plaza%3C%2Fspan%3E </details> <num_owned>720</num_owned> <is_racket/> <cost>1314000000</cost> <favor_points>0</favor_points> <name>Skyscraper</name> <income>$170,000</income> <built_on>Plaza</built_on> </land> − <land> <id>8</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fcasino%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Resort%20Casino%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24350%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Plaza%3C%2Fspan%3E </details> <num_owned>590</num_owned> <is_racket/> <cost>2700000000</cost> <favor_points>0</favor_points> <name>Resort%20Casino</name> <income>$350,000</income> <built_on>Plaza</built_on> </land> − <land> <id>10</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fshipping%5Fyard%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Shipyard%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%2420%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Seaside%20Lot%3C%2Fspan%3E </details> <num_owned>250</num_owned> <is_racket/> <cost>156000000</cost> <favor_points>0</favor_points> <name>Shipyard</name> <income>$20,000</income> <built_on>Seaside%20Lot</built_on> </land> − <land> <id>11</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fharbor%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Yacht%20Harbor%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%2450%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Seaside%20Lot%3C%2Fspan%3E </details> <num_owned>780</num_owned> <is_racket/> <cost>395000000</cost> <favor_points>0</favor_points> <name>Yacht%20Harbor</name> <income>$50,000</income> <built_on>Seaside%20Lot</built_on> </land> − <land> <id>12</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fresort%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Seaside%20Resort%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24200%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Seaside%20Lot%3C%2Fspan%3E </details> <num_owned>760</num_owned> <is_racket/> <cost>1540000000</cost> <favor_points>0</favor_points> <name>Seaside%20Resort</name> <income>$200,000</income> <built_on>Seaside%20Lot</built_on> </land> − <land> <id>13</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fmall%5Fv3%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Downtown%20Shopping%20Mall%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24500%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Plaza%3C%2Fspan%3E </details> <num_owned>750</num_owned> <is_racket/> <cost>3800000000</cost> <favor_points>0</favor_points> <name>Downtown%20Shopping%20Mall</name> <income>$500,000</income> <built_on>Plaza</built_on> </land> − <land> <id>19</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fland%5Fmark%5Fcasino%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Landmark%20Casino%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24550%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Empty%20Field%3C%2Fspan%3E </details> <num_owned>400</num_owned> <is_racket/> <cost>4100000000</cost> <favor_points>0</favor_points> <name>Landmark%20Casino</name> <income>$550,000</income> <built_on>Empty%20Field</built_on> </land> − <land> <members_req>50</members_req> <id>15</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fhelipad%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Helipad%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%24600%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Vacant%20Lot%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%3EEach%20Requires%2050%20Mob%20Members </details> <num_owned>12</num_owned> <is_racket/> <cost>660000000</cost> <favor_points>0</favor_points> <name>Helipad</name> <income>$600,000</income> <built_on>Vacant%20Lot</built_on> </land> − <land> <members_req>60</members_req> <id>16</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fairport%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Airport%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%241%2C000%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Empty%20Field%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%3EEach%20Requires%2060%20Mob%20Members </details> <num_owned>10</num_owned> <is_racket/> <cost>1800000000</cost> <favor_points>0</favor_points> <name>Airport</name> <income>$1,000,000</income> <built_on>Empty%20Field</built_on> </land> − <land> <id>22</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fforeign%5Fembassy%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Foreign%20Embassy%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%242%2C000%2C000%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landBuiltOn%27%20style%3D%27color%3A%23FFFFFF%27%3EBuilt%20On%3A%20Overseas%20Lot%3C%2Fspan%3E </details> <num_owned>100</num_owned> <is_racket/> <cost>16500000000</cost> <favor_points>0</favor_points> <name>Foreign%20Embassy</name> <income>$2,000,000</income> <built_on>Overseas%20Lot</built_on> </land> </establishments> <featured_lands/> − <locked_lands> − <land> <id>20</id> − <image_url> http%3A%2F%2Fcdn0%2Emobwarsapp%2Ecom%2Frpg%5Fimages%2Fopensocial%2Fmob%2Fingame%2Fterritory%2Fbig%2Fcatskill%5Fresort%2Egif </image_url> − <details> %3Cspan%20class%3D%27landName%27%20style%3D%27color%3A%23FFFFFF%3B%20font%2Dsize%3A18px%3B%20font%2Dweight%3Abold%3B%27%3E%20Catskill%20Resort%3C%2Fspan%3E%3Cbr%3E%3Cspan%20class%3D%27landIncome%27%20style%3D%27color%3A%23FFFFFF%27%3EIncome%3A%20%2425%2C000%3C%2Fspan%3E%3Cbr%3E </details> <num_owned>0</num_owned> <is_racket/> <cost>0</cost> <no_sell>true</no_sell> <favor_points>0</favor_points> <name>Catskill%20Resort</name> <income>$25,000</income> − <enhancements> − <enhancement> <value>2</value> <suffix>max energy</suffix> <prefix>+</prefix> <type>MAX_ENERGY_INCREASE</type> </enhancement> </enhancements> </land> </locked_lands> <num_mob_used>1200</num_mob_used> <num_mob_available>238</num_mob_available> <update_period>55</update_period> <minutes_to_update>9</minutes_to_update> <get_city_list>true</get_city_list> <request_id>7215441</request_id> </xml> </outer> I need to parse XML and this article helped me a lot: http://www.phpfreaks.com/tutorial/handling-xml-data The next thing I need is to parse only elements that meet certain conditions, lets say we have an XML with structure like this: <Result> <Line> <StockCode>0101009</StockCode> <Description>Description</Description> <ProductGroup>S01</ProductGroup> <Availability>0</Availability> </Line> ... </Result> I need to parse only the elements with ProductGroup = S01 and Availability = 1 How can I do that I'm trying to go through a document and replace all the UBB tags with different values. I can preg match the tags, but I don't quit remember how to do the replacement. Tags are like: ect. Anyone have a basic example I can go from? I know I've done it before, just can't think tonight. |