Re: Printing selected characters (strcnt?)
| From: | Matthew McNicol | Date: | Thu, 15 Jul 2004 22:14:09 +0000 |
| Subject: | Re: Printing selected characters (strcnt?) | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35291@lists.php.net to get a copy of this message | ||
Try this:
// takes the 1st character from $last_name and adds
// datetime in format of DDMMYYhhmm
$rma = substr( $last_name, 0, 1) . date("dmyHi);
See:
aspn.activestate.com/ASPN/docs/PHP/function.substr.html
uk2.php.net/date
Vincent Jordan wrote:
I am trying to figure out how to select the first letter of from the form field print it then append by datetime. Here is an example: <snip> $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $name = $first_name . ' ' . $last_name $rma = ?strcnt($last_name), 1 . Datetime(?) // takes the 1st character from $last_name and adds datetime in format of 715041200 </snip> Thanks any help appreciated Vincent Jordan Technical Support Smart Parts, Inc. Loyalhanna Business Complex 100 Station Street Loyalhanna, PA 15661 800-992-2147 X 5617-- _________________ Matthew McNicol yellowmarker.co.uk PHP / MySQL web development