note 47701 added to function.str-replace

From: Date: Thu, 25 Nov 2004 16:04:35 +0000
Subject: note 47701 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-81029@lists.php.net to get a copy of this message
My very simple way to add acronym tags on a message: function acronimo($inserito) { $prima = array( 'css', 'php', 'MySql', 'HTML' ); $dopo = array( '<acronym style="cursor: help;" title="CSS: Cascading Style Sheets">CSS</acronym>', '<acronym style="cursor: help;" title="PHP: Hypertext Preprocessor">PHP</acronym>', 'My<acronym style="cursor: help;" title="SQL: Structured Query Language">Sql</acronym>', '<acronym style="cursor: help;" title="HTML: HyperText Markup Language">HTML</acronym>' ); $messaggio = str_replace($prima, $dopo, $inserito); return $messaggio; } $messaggio = acronimo('Questo è un css'); print $messaggio; -------- Return Questo è un <acronym style="cursor: help;" title="CSS: Cascading Style Sheets">CSS</acronym> With this you can add how many Acronym you wish, take attention just to lower and uppercase (i had to fix this) ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47701 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47701&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47701&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47701&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47701&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47701&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47701&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47701&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81029) next »