| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Regular | Prevent Arrays From Executing Value.... Hey, Okay i am writing a bulk replacer that searches a document for a certain tag and then replaces it with the appropriate value/function value. But.. is there a way to get it not to execute every damn function listed in the array... god its hard to explain, ill let the code do the talking: PHP Code: Any ideas how to get it to to only execute tags found in the script? (Note that functions like get_header() will get the header file and bring some extra tags into the equation :P So thats why i've had to do it using this method in order... How do i get it to stop executing functions that aren't needed!
__________________ -Beaver6813.com V5 Soon! |
| |
| | #2 (permalink) |
| Adrian | Not entirely sure, and i don't really have time to look into it, now. However, it looks like somesort of template system, am i right? If so, you could take a look at my class, http://www.dreamit.co.uk/php-template-system-class/ That would work fine, and you can easily specify what to replace in what file. ![]() Adrian
__________________ |
| |
| | #3 (permalink) |
| NamePros Regular | Thanks Looks sweet ^^ Although because there are tags in more than one file... and then tags also in those files it makes it hard to replace them like you have but it certainly is some very clean code ![]() Resolved! Thanks Hitch I had a look at your code and then compared to mine, realized that it wasn't executing the functions and instead the db query counter was up the creek... fixed now :P Thanks & $Rep++;
__________________ -Beaver6813.com V5 Soon! |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |