Jump to content

spaze

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

spaze's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello all! I am writing a class where you set a string to be searched and a keyword to search. I have written so far: $replacement = '<' . $this->_htmlTag . ' class="' . $this->_htmlClass . '">' . $keyword . '</' . $this->_htmlTag . '>'; $result = preg_replace("/(>|^)([^<]+)(?=<|$)/iesx","'\\1' . str_replace('" . $keyword . "', '" . $replacement . "', '\\2')", $entry); This works fine as long as the search is case sensitive, It wraps found instances if they are not inside HTML tags. I can't seem to figure out how to make case insensitive replacement and I knwo why. It's because I wrap the search keywords with html tags and not the found instances, so can someone please show me how to complete this code to replace the found instances instead of using the str_replace?
  2. Would you want to start fiddling with a code that looks like that?
  3. I was thinking about creating a simple code obuscator just to make the code look ugly. Why? Because I would like to offer my application to one company but don't want them to temper with the code. Or at least, want to make tempering a notch harder for them to do it. So I was thinking about replacing all variable names with md5() so that: $variable_name will become $c2c78403824b7735ea954cece62534cb and $this->view->variable_name will become $this->view->c2c78403824b7735ea954cece62534cb But how should I go about this? Should I do regex on the whole file and replacing everything that comes after the $ character with md5 equivalent?
  4. I use the following function to get microtime: function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } How can I get date and time in microseconds?
  5. The first one works just fine, but the second one doesn't do much for the following line: <p> 9</p> It doesn't replace it with an empty one at all.
  6. I have an application to convert some HTML pages to work better on my ebook reader device. I need to replace two things: All leading and trailing spaces between opening and closing tags. Example: <p> blaa blaa</p> The other thing is I need to remove all <p></p> tags containg some number, can be with spaces or without and with line breaks. Examples: <p> 1</p> <p> 1</p> <p> 1 </p> Can someone help me with this issue as I don't seem to get it
  7. Hello, I have a response in HTML form from which I need to get data from between the <p id="myparagraph"> and </p> tags. For example: <html> <head> </head> <body> <p id="myparagraph"> sdfg dfgdfkjg dflkgj dflgkj dflgkdf g <br> dfgkjdflgkjdflgkjdflkgj </p> sdfsdfsdf sdfsdf fsdfsdf sdfsdf <p id="myparagraph"> sdfg dfgdfkjg dflkgj dflgkj dflgkdf g <br> dfgkjdflgkjdflgkjdflkgj </p> </body> </html> So what should I get is: sdfg dfgdfkjg dflkgj dflgkj dflgkdf g dfgkjdflgkjdflgkjdflkgj sdfg dfgdfkjg dflkgj dflgkj dflgkdf g dfgkjdflgkjdflgkjdflkgj basically what I am doing is creating my own custom RSS feed parser from a website that does not have RSS. All the paragraphs needed for the news content is within <p id="articleParagraph">....</p> and there can be n amount of these paragraphs per page.
  8. I created my own blog with ZF (http://www.majgaj.com/blog) and when I finished my project I realized I was missing the RSS feeds function. Since I had View and Models set, all I had to do was create rssAction() function into my controller and create new View for the actual RSS feed. All in all this RSS addition took me five minutes. If I would like to make a lighter layout for, say, mobile device, it would also take me five minutes to accomplish this. This is why I really like MVC design pattern.
  9. That is how things work on my web-hotel. if user's document_root in Apache is set to something else, these would go there ofcourse. In the installation package the Library in within the application directory, but on my web-hotel for example, the lib -directory is in a different location where multiple applications are accessing it. This also is modifiable through LIBRARY_PATH constant in main_config.php script. The reason is because on some commercial web-hotels there are no SQL databases available free-of-charge. Even though SQLite itself is usually installed in most Linux distros, the PHP might not be compiled with SQLite support for these web-hotel providers because they want to charge you for whatever database usage. This is the sole reason why I thought of adding the txtsql-db-api package to CodeFrame, to let those who don't have access to SQL database to still have the option to do SQL queries within their applications. Thanks. If nothing else, I will keep on working on this for the fun of it. I do actually use CodeFrame for many of my applications so its not at all "just for fun" project. I would love to get some people to work on this project to perhaps make yafw, yet another framework
  10. I created a Subversion repository in Google Codes, so that people can look at the source code before downloading. http://code.google.com/p/codeframe/source/browse/#svn/trunk
  11. I see your point Perhaps the configuration of BASE_URL is not so complicated after all. Thanks for your help!
  12. Hello, I would like to know what people here think about a framework I wrote. http://www.majgaj.com/codeframe This project was born some time ago and now I got inspiration to continue on this. Please have a look at the project and tell me your thoughts on it. Thanks!
  13. Thanks for your reply. I have done this already and current version does just this, but since the user needs to configure the application by having to know the base I was hoping to find a way to automize this. It would be neat to find the base_uri from which the script is running so that I could replace the URI portion of this base_uri with blank.
  14. Since I don't quite get what you trying to say, can you lead me a little toward the right direction?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.