For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > December 2005 > RE: [PHP-DB] Manipulating text









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] Manipulating text
Bastien Koert

2005-12-08, 9:58 pm

str_replace

$var = "play-time";

$var = str_replace("play-","",$var);

regex

$var = eregi_replace("[play-]","",$var);

B


>From: "Ron Piggott (PHP)" <ron.php@actsministries.org>
>Reply-To: ron.php@actsministries.org
>To: PHP DB <php-db@lists.php.net>
>Subject: [PHP-DB] Manipulating text
>Date: Thu, 08 Dec 2005 21:25:39 -0500
>
>If I have
>
>$variable = "play_time";
>
>how may I remove "play_" from $variable and just have $variable equal to
>"time"?
>
>Ron
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com