How-to use PHP substring() with variables
-
Hi,
In the following code, all I want to do is trim the string within the variable $[CustomerTestimonial] so that it is 140 chars long when it is returned. I would like to do something like:
substring(${CustomerTestimonial},0,140);
because some of the testimonials are really long. I’d like to keep them all the same length. But so far, I’ve been unable to get this to work.
Here is the code I created:
<h1>Testimonials</h1> [cfdb-html form="Customer Testimonials" show="CustomerName,CustomerTestimonial" hide="/submitted.*/" random="3" filter="CanPost~~/.*public*./i"] [testimonial author="${CustomerName}"] <div id="container"> <div id="testimonial">${CustomerTestimonial}</div> </div> [/testimonial] [/cfdb-html]
Thanks for any suggestions you might have!
http://wordpress.org/extend/plugins/contact-form-7-to-database-extension/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How-to use PHP substring() with variables’ is closed to new replies.