Jump to content

[SOLVED] Adding text


redfox180

Recommended Posts

Well, I just misplaced a ). Another time though, please state how "it isn't working".

 

<?php
$string = 'PD32TR/PD54YT/PD43QW/512RE/51QW/PD43WQ';

$parts = explode('/', $string);
foreach($parts as $key => $part)
{
if(substr($part, 0, 2) != 'PD') $parts[$key] = 'PD' . $parts[$key];
}
$string = join('/', $parts);

echo $string; // output: PD32TR/PD54YT/PD43QW/PD512RE/PD51QW/PD43WQ
?>

Link to comment
https://forums.phpfreaks.com/topic/87060-solved-adding-text/#findComment-445256
Share on other sites

Hrmmm...

 

 

I hadn't ever seen that either....

 

First Google result:

 

TMTOWTDI: /tim�toh'�dee/, abbrev.

There's More Than One Way To Do It. This abbreviation of the official motto of Perl is frequently used on newsgroups and mailing lists related to that language.

Link to comment
https://forums.phpfreaks.com/topic/87060-solved-adding-text/#findComment-445316
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.