In my project I want to analyze the source code of a PHP file and convert it to AST. There is already a javascript package for this, but it only works with node. So I tried to convert the PHP code to AST using a Rust library. However, I have no…
I want to change /<\?php\s([\s\S]*?)\?>/gi the way that single line PHP tags become excluded.
For example, here I want to match only second PHP tag and not the first one:
Test number is here.
This is test number
In the first.php file, I assigned some variables and defined some constant values,
define("CONSTANT1", "cons1value");
$variable1 = "var1value";
$variable2 = array(
"key1" => "value1",
"key2" => "value2"
);
I need to change values through…
I'm using PHP-Parser to parse PHP codes, and get the AST in Json format. I want to ask how to get the results without Attributes ( startLine, endLine, comment etc.)
Just starting with php and sorry if this is a newbie question but i'm having problems parsing a array.
I get this value(output of print_r($result);):
Array (
[0] => stdClass Object (
[Master_companyname] => Royal Bank of Canada
…
I read somewhere that php parses the whole .php file every time it is executed. Some solution was proposed in there (that was not opcache), but I lost the website and I couldn't find it.
Now I have an enormous php website that has many long…
$response var has a component called custom_test_name which looks like below:
[Test_Name]ad.no.check1.check2.check3
and here is the small PHP code:
";
?>
This prints…
To have my project respond to certain contexts of content, I want my CSS files to respond respectively instead of setting up additional CSS files (adds to http requests) or parsing the CSS right inside the respective php script (imho: quite messy).…
I have been trying to parse the the title and description from the following XML document (this is just the top part). I have found lots of information about dealing with namespaces but I cannot figure out how to deal with a situation involving…
I am building a site that parses a spanish dictionary. If you look up the word HOLA, you will receive the definition, but for other words, you get suggestions, like CASA: http://verbum.xtrweb.com/verbumpost.php?word0=hola&word-1=casa
I wish to: when…
I am parsing html in php and as I have no control over the original content I want to strip it of styling and unnecessary tags while still keep the content and a short list of tags, namely:
p, img, iframe (and maybe a couple of others)
I know I can…