php - Function always returns same value -


i created function in php searches [profile|title] , creates url profile...

function profiletageplorer($message, $url) {    $startlinktag = '<a href="' . $url .'">';   $endtag = '</a>';   $res = preg_replace('#(\[profile\|)([a-za-z0-9áčďéěíňóřšťůúýžÁČĎÉĚÍŇÓŘŠŤŮÚÝŽ\s]*)(\])#', $startlinktag . '$2' . $endtag,    $message);   return $res; } 

above in code have following cycle...

foreach ($owners $owner) {    // prepare header   $ep = new emailprinter();   $ep->setreceiver($owner->email);   $ep->setsubject($title);    // message    $message = profiletageplorer($message, $owner->url);   $ep->settext($message);   $res = $ep->sendmail(); } 

i've checked $owner->url contains unique url each iteration. profiletageplorer function returns same result in every iteration, no matter parameter changing.

this same value equal url first iteration of cycle.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -