Re: eregi_replace returns only lowercase
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Mon, 03 Nov 2008 08:15:50 -0500
Bob wrote:
Hi,
Maybe this problem has already been mentionned, but I am new to this group, so here we go.
$string = "This is for ABC only"
$new = (eregi_replace('ABC','<b>ABC</b>',$string));
print $new geeft nu This is for <b>abc</b> only
where I would like to see 'abc' in uppercase. I have searched the internet for the solution, consulted several PHP books, but can not find the solution. Can anyone help? Thanks.
Bob
A regex is way overkill in this case. Just concatenate <b> and </b> before and after your user input, i.e. (in another post you indicate this is user input):
$new = "<br>{$POST['user_field']}.<br>";
Or, if you prefer,
$new = '<br>' . $POST['user_field'] . '<br>';
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- eregi_replace returns only lowercase
- From: Bob
- eregi_replace returns only lowercase
- Prev by Date: Re: templates
- Next by Date: Re: Php Documentor Website
- Previous by thread: Re: eregi_replace returns only lowercase
- Next by thread: Stats comp.lang.php (last 7 days)
- Index(es):
Relevant Pages
|