What about conditions??
And what if there are two variables in a condition?
Like
«ELSE IF PQR = "2" AND XYZ = "Some String"»
0
diafol
I really, really don't udnerstand what you're trying to achieve. The hotdoc is a template, specifically produced to work with a particular parser. Why do you need to change it to php?
I can not change.
What I really want to do is that. I have RTF file. On the other hand I have an array of values to replace.
Thay way I want to achieve this goal is to open the file with fopen, and then replace variables with values, and also parse condition to show response.
0
diafol
Ok, in that case, your best bet would be to convert the document to a php file and use that as an include file. Either that of use a proper php templating engine. There are many to choose from, the most popular being Smarty, RainTPL and the more recent Twig (which is REALLY cool).
For example, a twig html document would look like this:
And also I could not find ending tag. Starting charrsid8996477 is given and it is ending with "}"
0
diafol
How many are you talking about?
I can't see an easy way around this. Replacing just the if blocks could become a nightmare. It could also be the case where if conditions are a little more complex in some templates, so that your replacement fails.
A few hours converting these files manually may be quicker than writing a fance preg_replace routine that is likely to fail anyway.
There are about 30 files. And as I said these files are being used in other ways / other system. So modification of these files will create duplication, and when a single word in a file need to change, We will have to make these changes in my PHP files too.
To resolve this issue I wanted to use files as these files are provided to me.
0
diafol
I really can't see a way of producing a 'duplicate' php file from these types of template file without writing a hefty custom parser.
APLX is a very complete implementation of the APL programming language from MicroAPL. The company stopped producing it in 2016 and it has been taken over by Dyalog. While Dyalog ...
I try to create a simple OOP PHP that shows an error:
class_lib.php
<?php
class person {
var $name;
function __constructor($person_name){
echo "Initialize class";
}
function set_name($new_name){
$this->name($new_name);
} ...