本文整理匯總了PHP中test::wytnijZmienna方法的典型用法代碼示例。如果您正苦於以下問題:PHP test::wytnijZmienna方法的具體用法?PHP test::wytnijZmienna怎麽用?PHP test::wytnijZmienna使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類test
的用法示例。
在下文中一共展示了test::wytnijZmienna方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: main
<?php
$string = 'echo \'Hello\' World\';';
echo $string . "\n";
class test
{
function znajdz1($wyraz)
{
$regex = "/echo\\(\".*\"\\);/";
preg_match($regex, $wyraz, $zmienna);
return $zmienna[0];
}
function wytnijZmienna($string)
{
$regex = "/\".*\"/";
preg_match($regex, $string, $zmienna);
$wyraz = trim($zmienna[0], "\"");
return $wyraz;
}
function changeText($hello)
{
$string = 'public static void main(String[] args) {' . "\n";
$string .= "\t" . 'System.out.println(\'';
$string .= $hello;
$string .= '\');' . "\n" . '}' . "\n";
return $string;
}
}
$t1 = new test();
echo $t1->changeText($t1->wytnijZmienna($t1->znajdz1('echo("dupa");')));
示例2: wytnijZmienna
<?php
class test
{
function znajdz1 ($wyraz)
{
$wyraz = $wyraz;
$regex = "/System\.out\.println\(\".*\"\);/";
$wynik = preg_match($regex, $wyraz, $zmienna);
return $zmienna[0];
}
function wytnijZmienna ($string)
{
$regex = "/\".*\"/";
$wynik = preg_match($regex, $string, $zmienna);
return $zmienna[0];
}
}
$t1 = new test();
echo $t1->wytnijZmienna($t1->znajdz1('System.out.println("z upa");'));