|
Posted by Mike Collins on 08/23/06 20:09
On Wed, 23 Aug 2006 21:56:09 +0200, "Rik" <luiheidsgoeroe@hotmail.com>
wrote:
>> preg_replace(
>> '/<img #comments are cool
>> [^>]*?
>> (
>> alt\s*=\s*
>> (\'|") #match the quote
>> ([^\2]*?) #get alt content; dont be greedy
>> \2 #use matched quote
>> )
>> .* #chop and toss
>> /ix
>> ',
>> '$1', $row['text']) . ' (<b>IMG ALT</b>)';
>>
>> The tag below won't ruin my day but the results won't be pretty. Tried
>> the m modifier, no dice.
>>
>> <img src="/img/l_eng.png"
>> alt=""
>> width="27"
>> height="20"
>> />
>
>Well, exactly what do you want with alt="", no match, an empty string?
I can assign anything to it. The way I'm using it here I just echo
alt="" (<b>IMG ALT</b>)
alt="whatever, either is fine" (<b>IMG ALT</b>)
If I scrape links off a page with snoopy and output them to a browser
broken image links annoy me. Thanks to you, I'm smiling.
Navigation:
[Reply to this message]
|