BB Code Parsing
how would I go about coding a vBulletin style BBcode parsing engine?
eg. to translate [ b] something [ /b] into <b>something</b> etc
I know i need todo regular expression searches on the strings, however im a reg-exp newb and really need some guidance. Alternatively, are there any free premade classes etc I could us?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Can PHP Parsing Xml Code ?
I am looking for a programming script to parse a xml file. Can PHP do it. The xml file is from other web site and i need to parse it into my html page.
PHP Not Parsing This Code?
I'm trying to populate an array (with some strange characters). The problem I'm having is the page will ether come up blank, but show the code in the "page source". Or, some or all of the source is sent directly to the browser, like PHP didn't even parse it. I've tried this on a few different servers and get similar, though slightly different results. Here are some examples of what I'm trying to store: Code:
Help My Slow Parsing Code!
Here's my situation...I've been learning to write PHP for awhile and have been trying to rewrite my web site from plain old static pages to PHP versions. I've been learning based on what I want to do, put my links and articles in databases and allow comments and ratings. I have a test page here: URL I've managed to write the PHP code to do just about everything I wanted, but it takes about 3+ seconds for the page to start to load (and it didn't when it was a static page). I know that this is because of my badly formed PHP no doubt. The routines do what I want, but there HAS to be a much more efficient way to get it done. I'm going to post the code (stipped of font tags and error catching statements). Please advise the easiest way to streamline this code (and or SQL statements) in the best interest of the server processing time (any help would be great!): <?php //Start of routine for animation links $usr = "user"; $pwd = "pw"; $db = "db"; $host = "host"; $cid = mysql_connect($host,$usr,$pwd); ?> <?php //We want the Animated Gif category $category = "1"; $SQL = " SELECT * FROM links_temp"; $SQL = $SQL . " WHERE category = '$category'"; $retid = mysql_db_query($db, $SQL, $cid); //Throw the links in an array - html table loop print ("<center><table cellpadding=2 cellspacing=0 width=100% border=1> "); while ($row = mysql_fetch_array($retid)) { $siteurl = $row["siteurl"]; $sitename = $row["sitename"]; $description = $row["description"]; //cocatenate together anigif_ with each item id for unique rating value $id = "anigif_"; $id = $id . $row["id"]; print ("<tr><td width=100% valign=top>"); //Lets start the form here for the voting to elimate a line break later print ("<form method="POST" action="/test/rating4.php" onsubmit="return genwin()" target="newwin"> "); print ("<A HREF='$siteurl' target=_blank>$sitename</A>"); //While in the while loop lets start another db connection to get item ratings $usr3 = "user"; $pwd3 = "pw"; $db3 = "db"; $host3 = "host"; $cid3 = mysql_connect($host3,$usr3,$pwd3); $SQL3 = " SELECT * FROM ratings_temp WHERE item = "$id""; $result3 = mysql_db_query($db3,"$SQL3",$cid3); $num_rows = mysql_num_rows( $result3 ); if ($num_rows==0) { echo ("No Votes yet"); } else { print " $num_rows Votes, "; $SQL4 = "SELECT AVG(value) AS avgRating FROM ratings_temp WHERE item = "$id""; $result4 = mysql_db_query($db3,"$SQL4",$cid3); print "Rating: " . mysql_result($result4,0) . "<br>"; } mysql_close($cid3); //end of the db connection for ratings print ("$description<br> "); print ("Vote for this Site! "); print (" <select name="rating" size="1"> "); print (" <option value="5" selected>5 - Superb "); print (" <option value="4">4 - Tasty "); print (" <option value="3">3 - Average "); print (" <option value="2">2 - Bland "); print (" <option value="1">1 - Rotten "); print (" </select> "); print (" <input type="hidden" name="item_id" value="$id"> "); print (" <input type="submit" value="Vote"> "); print ("</form> "); print ("</td></tr> "); } //end of the array subroutine making table rows print("</table></center>"); //end of the table after the array ends ?>
Parsing PHP Code In MySQL Results Set?
I have a PHP script that pulls content from an MySQL database and returns a result set. Is there a way I can put PHP code within a field in the database and have that code parsed as PHP code on returning a results set? If possible, I want just one field of the database parsed for PHP code. The results set is return as a straight result, not within a loop. Just inserting the <? PHP code thus ?> returns that as sources code not parsed.
Parsing String With Embedded PHP Code...
On my webserver right now, I have a folder of webpages with embedded PHP coding. Because the dynamic content changes very infrequently, I've written a script which generates a "static cache" of HTML pages from the PHP pages. It works by automatically looping through all PHP pages in the folder. For each, it reads the contents of the PHP file into a variable, then creates a new HTML page with the same name and writes the contents of the variable to it. After the process is complete, the cache of HTML files gets uploaded to the website for public viewing. However, if the script reads the contents of the PHP pages through the local filesystem, the temporary variable (and thus the resulting static .html page) will have PHP code within it, which is obviously no good. Therefore, at the moment, the script reads the contents of the PHP pages by opening an http connection to where they reside on the public webserver... this makes the contents of the temporary variable equivalent to the HTML that would be outputted when any user accessed the PHP page through the WWW, which is exactly what I want. However... my problem is that the http connections are much slower than reading through the local filesystem, and moreover, I don't necessarily want the PHP pages to be publicly accessible through a webserver, which is currently required for the script to work. Is there any way that I can take a PHP string that has embedded PHP code and tell PHP to "parse the PHP out of it"?
Old Code Vs New Code - Language Syntax Change?
I've recently begun programming PHP again and have found my old code doesn't work anymore. It's been a few years since my code was written, and simple functions don't seem to be working. I've done a bit of research into the syntax again and found the following; I used to use a function as such; if ($REQUEST_METHOD=="POST") { Now I've seen alot of the syntax is if ($_SERVER($REQUEST_METHOD=="POST")) { And referencing variables from the form is as such; $_POST['variable'] Where previously I could reference them in the simple form; $variable Has there been a language syntax change that would cause my old code to be obsolete? Is there a configuration line that could be changed to allow this old code to work?
BB Code - Escape A Bracket In BB Code?
Is there a way to escape a "bracket" in BB code? The beginning of a bbcode post I made starts with something in brackets [like this]. This causes a strange thing to happen to the remainder of my post. Removing the brackets makes my post normal. That shows me that I need to escape the brackets. However, a simple backslash does not seem to do the trick i.e. this [wont work] I am not the administrator of the bb forum, just a poster. So I need to know what to do on my end (as opposed to an adiministrator's power to reconfigure, etc.
Code To Display My Code
I am taking a class in PHP and thought that it would be nice to display the PHP code that generated my pages when the user clicked a link (or submit button). I have seen page that will display the underlying HTML on the page and it would be a nice touch...
Parsing .inc As .php
how do I parse .inc as .php files? Is it that useful to do this? Is it so unsafe to include() them otherwise? On my Linux box, I've got both httpd and httpd2.conf (don't ask me, it was auto-configured that way). I think both files are useful, but in which of these do I insert whatever you're going to give me?
URL Parsing.
I have come up with a couple ideas, but I would like some input on the most effective way to parse a URL from the body of a mail message. I have a small script which accesses mail for an account and retrieves the message body(imap_body). I want to parse through the body and pull out URL's, anyone have some good advice on a practicle method?
Parsing XML,RSS Through PHP
Do anybody know 'bout parsing RSS through XML (PHP). I wanna learn RSS, but before that i must know XML. It would be helpful if anybody guide me in the right direction from where to take start learning XML (link, url). And after having the elementary knowledge 'bout XML i would be able to parse RSS.
Parsing XML
I'm trying to figure out how to parse very simple XML files using PHP 4.3. I have been unsuccessful at finding simple explanations of how to do this. I found the following code somewhere (can't remember where) and it works great EXCEPT it does not keep my CSS class tags. The result is that everything shows up as a <p> rather than <p class="text">, etc. How do I modify this code to allow this? Or is there a better way to accomplish this? <?php $file = "myfile.xml"; $map_array = array( "bold" => "b", "emphasis" => "i", "literal" => "tt" ); function startElement($parser, $name, $attrs) { global $map_array; if (isset($map_array[$name])) { echo "<$map_array[$name]>"; } } function endElement($parser, $name) { global $map_array; if (isset($map_array[$name])) { echo "</$map_array[$name]>"; } } function characterData($parser, $data) { echo $data; } $xml_parser = xml_parser_create(); // use case-folding so we are sure to find the tag in $map_array xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); if (!($fp = fopen($file, "r"))) { die("could not open XML input"); } while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } } xml_parser_free($xml_parser); ?>
Parsing An URL
I want a PHP script that will for example split http://example.com/dir/index.htm into http://example.com/dir and index.htm It also needs to split up an URL with GET variables at the end. eg http://example.com/dir/link.php?id=123&no=abc Any help would be appreciated...
Parsing XML
I have some problems with parsing this sample xml file. <section id="L11"> <group id="L21"> <field key="name1" value="1"/> <field key="name2" value="2"/> <field key="name3" value="3"/> <field key="name4" value="4"/> <field key="name5" value="5"/> <field key="name6" value="6"/> </group> <group id="L22"> <field key="name7" value="7"/> <field key="name8" value="8"/> <field key="nam9" value="9"/> </group> </section> <section id="L12"> <group id="L23"> <field key="name10" value="10"/> <field key="name11" value="11"/> </group> <group id="L24"> <field key="name12" value="12"/> <field key="name13" value="13"/> <field key="nam14" value="14"/> </group> </section> PHP Code:
Xml Parsing With Php
I use PHP (and PHP socket functions) to exchange very short XML documents between two Flash clients like this: <MESSAGE id="myid" text="mytext" /> I don't parse the XML document within PHP but send back the XML document made by the Flash client to another Flash client with a php socket and Flash parse it with its own XML parser ... In order to detect errors or non-XML data I do like this (in php): switch (true){ case ( ereg("<", trim($XMLdata)) ): print 'xmldata' break; default: print 'no xmldata' } (I must do this because Flash sends an empty "heartbeat" every 5 seconds, which is not XML data) Now, I need to interpret my XML document inside php cause I want to make php execute some commands when it receives a certain type of XML element. XML data that can be sent from Flash : <MESSAGE id="myid" text="mytext" /> or <COMMAND1 /> or <COMMAND2 /> or or an empty string "" . (in php) I can do : switch (true){ case ( ereg("<MESSAGE", trim($XMLdata)) ): print 'xmldata is a txt message' break; case ( ereg("<COMMAND1", trim($XMLdata)) ): print 'xmldata is a command1' break; case ( ereg("<COMMAND2", trim($XMLdata)) ): print 'xmldata is a command2' break; default: print 'no xmldata' } But what I'm wondering is whether it is the good way to proceed, wouldn't it be faster to parse the xml document within php with Expat library included when it receives a document "<COMMAND idcom="1" />" and interpret "idcom" value instead of doing an "ereg("<COMMAND1", trim($XMLdata))?
XML Parsing!
I've looked and searched and tried to find information about how to solbve this problem, but I can't. I'm beginning to think that I should start from scratch to do it right. I am trying to parse the data from the weather channel in PHP. A slice of the data looks like this: <weather ver="2.0"> <cc> <lsup>3/4/05 8:50 AM Local Time</lsup> <obst>Vasteras, Sweden</obst> <tmp>-7</tmp> <flik>-12</flik> <t>Mostly Cloudy</t> <icon>28</icon> <bar> <r>1,010.8</r> <d>steady</d> </bar> <wind> <s>10</s> <gust>N/A</gust> <d>180</d> <t>S</t> </wind> <hmid>83</hmid> <vis>10.0</vis> <uv> <i>0</i> <t>Low</t> </uv> <dewp>-9</dewp> <moon> <icon>22</icon> <t>Waning Half, Last Quarter</t> </moon> </cc> </weather>.......
Looking For Help With RSS Parsing
I'm working on a script to work with podcast feeds (RSS) and have found the lasRSS parser to be quite good. http://lastrss.webdot.cz/ I've modified this to work with i-tunes tags (as they have added their own to the RSS vocabulary!) however I still have one set of tags - category - that I am stuck with. an example of these tags (Category Technology, Sub Category Computers) would be: <ITUNES:CATEGORY TEXT="Technology"> <ITUNES:CATEGORY TEXT="Computers"></ITUNES:CATEGORY> </ITUNES:CATEGORY>
Parsing XML?
I have a slight problem with parsing XML: If the tag was say - <Something ID="12"> - My parser is only retrieving the 'Something' part, and discarding the 'ID="12"'. Code: function startElement($xml_parser, $name, $attrs) { echo $name; //this is the part with the issue } function endElementStuff($xml_parser, $name) { } function charData($xml_parser, $data) { echo $data; } $xml_parser = xml_parser_create(); $ml_set_element_handler($xml_parser, "startElement", "endElementStuff"); xml_set_character_data_handler($xml_parser, "charData"); xml_parse($xml_parser, $result, TRUE); xml_parser_free($xml_parser);
Parsing Xml
I am trying to parse a very large rdf file, 585 MB to be exact. It's content.rdf.u8, dump file from the open source directory: www.dmoz.com/rdf I have parse the smaller version (30K) of the file, but no luck with big one. If anyone has parsed this file or knows how to parse this type of file.
Xml Parsing
i am trying to read an xml file using php and i am stuck at a place, below are my xml tags, i have to retrieve the attributes of the parent and the corresponding tags Code:
Xml Parsing
I've spent many hours trying to understand why the dom-functions in php do this and that, but the following I can't understand: My xml-file looks like: <Data> <Article> <Number>3746</Number> <Description>This is the article description</Description> <Groups> <Group1>Group1</Group1> <Group2>Group2</Group2> <Group3>Group3</Group3> </Groups> </Article> </Data> having the current node "Groups", I call //-- snip $childNodes = $curNode->child_nodes(); echo "Number of child-nodes: " . count($childNodes) . "<br>"; //-- /snip The output is: "Number of child-nodes: 7" When I echo the node_name() of each child-node, every second node is called #text Could anyone of you explain why php reacts like this? I would expect a child-count of three and definitely no #text-nodes...
RDF Parsing
I'm looking for an easy to use and understand RDF parser for PHP. Preferably lightweight if possible. I'm currently trying to get my head around this one.: http://www.wiwiss.fu-berlin.de/suhl/bizer/rdfapi/ are there any others that might be considered to be better quality or easier to use?
Parsing An XML (same TAG Name)
I am stuck processing an XML file. The problem I am having, is I have the same TAG name - Url - at the same depth, so the value from the last Url read in is what get saved. I have tried every option I can think of to put each URL tag into its own variable, without any luck. I removed portions of the code that does not affect the outcome (for a smaller post). Here's a snippet of the XML, and when the code (below) runs, no matter what, the value of $items[$itemcount]['url'] is always /TiVoVideoDetails?id=465887. - <CustomIcon> <Url>urn:tivo:image:save-until-i-delete-recording</Url> <ContentType>image/*</ContentType> <AcceptsParams>No</AcceptsParams> </CustomIcon> - <TiVoVideoDetails> <Url>/TiVoVideoDetails?id=465887</Url> <ContentType>text/xml</ContentType> <AcceptsParams>No</AcceptsParams> </TiVoVideoDetails> PHP code: <?php class Tivo_XML { var $dvr; function parseTiVoXML() { global $items; $this->parser = xml_parser_create(); xml_set_object($this->parser, &$this); xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false); xml_set_element_handler($this->parser, "_tivostart_element", "_tivoend_element"); xml_set_character_data_handler($this->parser, "_tivodata"); $file = $this->dvr . "_nowplaying.xml"; $tivoxmlstr = file_get_contents ($file); $tivoxmlstr = str_replace("&", "%amp;%", $tivoxmlstr); xml_parse($this->parser, $tivoxmlstr , true) or die (sprintf("XML Error: %s at line %d", xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser))); xml_parser_free($this->parser); return $items; }
XML Parsing
I have been trying to wrap my head arouns this, but I can't seem to get it to work the way I want it to. Could someone helpful please tell me how I get this: <function> <name>array_push</name> <examples> <example> <name>A way to do it</name> <code> $array = array("foo", "bar") $array = array_push($array, "goo") </code> </example> </examples> </function> To this: array ( name -> array_push examples -> array( example -> array( name -> A way to do it code -> $array = array("foo", "bar") $array = array_push($array, "goo") ) ) ) My problems so far has been traversing the xml in a good way and: 1. After parsing, I am left with the code stripped of variables '$array = array("foo", "bar")' becomes ' = array("foo", "bar")' 2. Newlines in the code disappaers, how do I make them stay? Anyone feeling overly helpful and could give me an example to make the above xml into the above array.
How To See Without Parsing
I am trying to learn some php and sometimes i want to see how other people do it. My question is: is there a way for me to view the original unparsed file and not the result? If i simply click on it i see the reulting html. I want to see the source.
PHP 4.0.6 And XML Parsing
I wrote an XML parsing class, and the day that my host upgraded to PHP 4.0.6, my script quit working. At first, I thought XML parsing in general was hosed, but I used a quick XML parsing script and it worked fine. I think I found the issue. Here's what my class looks like: PHP Code:
XML PARSING
I am working on a project where I am parsing an xml document. The document is converted from a rich text microsoft word document. I'm using this standard parsing method: $xml_parser = xml_parser_create( $type ); xml_set_element_handler($xml_parser, "start_element", "end_element"); xml_set_character_data_handler($xml_parser, "character_data"); When I run the script using this Method, the text will randomly cutt off before the xml string has been parsed.
Parsing XML With PHP - Not DOM XML
I am not really sure how to parse files with PHP XML other than DOM XML. Unfortunetely, I have run into a few problems with size and was told that for the type of parsing I am doing I would be better using event driven parsing like SAX. Below I have a simple example of XML similar (although much much smaller) to the one I am using for real. XML: <?xml... <root> <name age="25">Martyn</name> <name age="24">Neil</name> <name age="24">Robbie</name> </root> All I want to do is to output them as: Martyn (25) Neil (24) Robbie (24) How would I do this uisng something like SAX / EXPAT? I found tutorials but didnt really understand them enough to know if I was looking up the correct thing.
XML Parsing - Help!
I've been following this tutorial and can get it working, but what i want to do is take the data from a dynamic aspx xml file $xml_file = "http://www.example.com/xml/Search.aspx?make=Ford&model=Accord"; i have downloaded the source of this aspx file and saved it as an xml and I can get it to work. the error I get when trying to parse the dynamic xml is "Could not read file" this tells me so far that it has successfully read this file using 'fopen' but it cannot read it using 'fread' can anyone shine some light on me on how to successfully parse an aspx xml feed with php? is it something to do with the values in the url?
Parsing
in a php script i'm writing, i want to set $email=fire_juggler_03@hotmail.com.nospam but it doesn't like it. How should i write the underscores? because i know you have to ' for apostrophes.
Parsing
What i am trying to do is parse some information from a site (easy enough) however i need to be loged in to the site to get that information and i have no idea how to do that. Could someone give me an example please? http://sigil.outwar.com login_username=username login_password=password Once loged in i then need to go to another page which can just be linked to once loged in.
RSS Parsing
I`m making a website that will parse rss from blogs. First i used magpierss but it did`t satisfy me because of those annoyng charsets. Anyway, right now i`m using another parser. This is my concern: How to parse all the data from rss including categories and subcategories from blogs. I mean, how to insert in database the categories and subcategories and how to query them? I made the categories and subcategories table in mysql, but how to insert from rss to mysql? When i enter a rss feed to parse, it grabs it all.
Parsing Xml
I want to be able to search xml document (using it as a db) and display the results out of it. i've done that in aspx before, and have the code for it. i am new to php and want some help in this regard. my xml document looks like this: Code:
XML Parsing With PHP
Using a code example posted by amitkrghosh, I've been able to almost get my XML parsing to work as I planned but need a bit of help taking it the rest of the way home. I'm an XML neophyte at best so any help here would be much appreciated! I am pulling data from a weather XML document. I've been able to modify amitkrghosh's code so that it only pulls from the weather stations that are relevant to my viewers. However, it just lists everything within that element (and its children) and doesn't allow me to show info how I want. I'm sure this is due to the foreach loop at the end of the code but I'm just not good enough to change that to allow me to show the info I want. Code:
Parsing From Url
I have a quick question i have the user click on http://sometime.com/page.php I want to send some variables with that url they are $objTask->p('eric') $objTask->p('cuoos') $objTask->p('clli') how would I send them with that page?
Parsing Key/value
I am receiving a response from a post into $response. I need to extract the key/value pairs and format up a new parameter string and send it to another servlet. Can I extract the key/value with something like this? $response_vars = (explode '&', $_response) $pairvalue = (explode '=', $_response_vars) foreach ($pairvalue as $k => $v){ $data .= $key . '=' . urlencode($value) . '&'; } and then use this to execute a well formed url and post it? curl_setopt($curl_handle, CURLOPT_URL, "https://mydomain.com/context/myAction.do?"); curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data); $response_2nd = curl_exec ($curl_handle) or die ("There has been an error connecting");
XML Parsing
When I run... foreach($batch_1_data as $book) { echo "BOOK ISBN: "; print_r($book->ASIN); echo "<br>"; } ...I get... Code: BOOK ISBN: SimpleXMLElement Object ( [0] => 0007149670 ) BOOK ISBN: SimpleXMLElement Object ( [0] => 0023963603 ) BOOK ISBN: SimpleXMLElement Object ( [0] => 0028624491 ) BOOK ISBN: SimpleXMLElement Object ( [0] => 002863716X ) BOOK ISBN: SimpleXMLElement Object ( [0] => 0020423500 ) BOOK ISBN: SimpleXMLElement Object ( [0] => 0015678326 ) BOOK ISBN: SimpleXMLElement Object ( [0] => 0006547583 ) BOOK ISBN: SimpleXMLElement Object ( [0] => 0006547567 ) BOOK ISBN: SimpleXMLElement Object ( [0] => 0006478964 ) BOOK ISBN: SimpleXMLElement Object ( [0] => 0023963700 ) and I'm trying to get... Code: BOOK ISBN: 0007149670 BOOK ISBN: 0023963603 BOOK ISBN: 0028624491 BOOK ISBN: 002863716X BOOK ISBN: 0020423500 BOOK ISBN: 0015678326 BOOK ISBN: 0006547583 BOOK ISBN: 0006547567 BOOK ISBN: 0006478964 BOOK ISBN: 0023963700 I've been playing around with this for an hour or so and was wondering how this is supposed to be done using Simple XML. I know I can just use a string function and remove the excess data, but it's not the best way to do this.
Validating XML Before Parsing In PHP
Does anyone out there is devshed land know of an easy way to valdiate an XML file before trying to parse it in php. I generate XML from a variety of sources and sometimes get funky charecters, bad tag names, and empty tags "<></>" and other wierd stuff. Is there a simple way to check a large xml file (1000k-100,000) before I run my parser on it. Also, when the built in XML parser hits one of these errors in the it just exits with out returning any usefull error. I could post the code if any one would like to see it, but it is very complicated and poorly documented.
URL Parsing - Preg_match
I have a url that I would like to parse in a particular manner that I have not quite found on the site or internet how to exactly do. My knowledge and skill with prel reg expressions is limited and I can understand a parsing pattern but i cant quite write my own yet. What I want to do is take the url for example: http://somehost.somedomain.toplevel...efile.something I want to parse it and get the host.domain name, just domain name, and then just the file at the end. I have tried a few things and gotten the host.domain and just the domain name, but have yet to figure out how to exactly get the file at the end because of the file may have more than a 3 letter extension.
Array Parsing
I need help parsing an array. all i'm trying to do is run htmlspecialchars() through all the peaces in the array. Dont matter how it gets done just as long as it's done.
Parsing With Regex
I am trying to parse a block of repeating code that looks like this" <span class="span1"> Some text </span> <span class="span2"> Some text </span> <span class="span3"> Some text </span> I've tried to extract the first line using of each block using: eregi("<span class="span1">(.*)</span>", $code, $span1); The only problem is, it doesn't stop at the first </span> after <span class="span1">. It continues all the way to the last </span> tag. Is there a way to modify the regex to stop at the first </span> tag?
Excel Parsing
Is there any easy way to parse excel document in php..I have to parse a excel document and display the info in a form ,so the user can edit the excel document.
Need Help Parsing Php Thru Apache
I had PHP4 working fine thru Apache on a windows ME laptop however, I nanged up and did something odd (in the file association) as now when I try and parse any php documents all I get is the Open with dialog box. What should the correct file associations be as I cant get apache to recognise any php files. Any help greatly appreciated.
Parsing Files
I encountered the concept of templates and parsing files. For example: sometimes when you search a site, and when you visit links that the engine returned you found your query highlighted inside the text. Very nice. They parsed the file you requested and put some nice formatting around all occurences of your querystring. I would like to apply it different, more in a sense of: you enter a URL in the address bar, and this file is parsed before it is shown to you. An application would be:all e-mail addresses inside the file are replaced by mailto:hyperlinksall static hyperlinks inside the file are replaced by real hyperlinks etc. A normal php-file at my site looks like: - php-include (html: header) - text: html formatted - php-include (html: footer) How can I achieve that when this file is loaded all occurences of some kind (stored in an array containing all needles) are handled in some way to show appropriate hyperlink-formatting before it is presented to the user. (much like a dictionary: words in the text can be references and are explained elsewhere). It is required that the text stays the same and the file can be loaded stand-alone (without querystrings).
File Parsing
I have a file, and I want to start searching it at a certain location, not from the begenning. I use strpos() to find a certain string in the file, and I would like to use a regular expression on the rest of the file after that point returned by strpos().
|