Yani değeri olsun Başka bir PHP dosyası değiştirilir olan bir PHP değişkeni var. Örnek:
$var = "~~~OtherVariable~~~";
Ben bu değişken echo, eğer uygun dize yazdırır. Örnek:
echo $var; //prints out "This is a string of text";
Her şey bugüne kadar çalışıyor gibi Öyle görünüyor, benim PHP değişken ($var) aslında dize içerdiğini göstermektedir "This is a string of text" olup "~~~OtherVariable~~~".
Şimdi burada sorun geliyor, I [(1)] {olması nerede (aynı sayfada), ben değişkenleri ($var) istediğiniz başka sahip başka bir PHP fonksiyonu değeri, bu PHP değişkeni kullanmak istiyorum }, ancak bunun yerine fonksiyon ne istiyorum, hangi değil "~~~OtherVariable~~~" olarak okuyor!
Fonksiyon "This is a string of text" yerine olarak değişken okuma yapmak için bir yolu var mı "~~~OtherVariable~~~"?
Teşekkür Guys & Gals
EDIT: İşte kodun bir yığın:
$string = "~~~ItemTitle~~~"; /*Another php file looks for any string in
this file with "~~~ItemTitle~~~" and replaces it with another block of
text, ie. "This is a string of text, http://www.google.ca" */
//Then I have a little function to look for any links inside of a string of text
function do_reg($text, $regex)
{
preg_match_all($regex, $text, $result, PREG_PATTERN_ORDER);
return $result[0];
}
$regex = '\b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]';
$regex = '$'.$regex.'$i';
$A =do_reg($string, $regex); /* This is where I tell it what string I want
it to look into for any URL's */
foreach($A as $B)
{
echo "$B<BR>"; //Prints out just the URL
}
Ben söylediğimde Ama çok bu "~~~ItemTitle~~~" ve metin dizesi o kadar yerini alır değil gibi okur $string değişken bakın.