Hi.
I've got this form:
<form action="/admin/post-new.php" method="post" name="frm_write_post" id="frm-write-post">
<fieldset id="post-fieldset">
<p class="input-wrapper"><input name="post_title" type="text" value="" id="post-title" />
</p>
<p class="input-wrapper"><textarea name="post_preamble" id="post-preamble" cols="50" rows="50">
</textarea>
</p>
<p class="input-wrapper"><textarea name="post_content" id="post-content" cols="150" rows="150">
</textarea>
</p>
<input name="write_post" type="submit" value="Save" id="save-post" />
</fieldset>
</form>
If I wanted trasform it in something like this:
<form action="/admin/post-new.php" method="post" name="frm_write_post" id="frm-write-post">
<fieldset id="post-fieldset">
<p class="input-wrapper"><input name="post_title" type="text" value="" id="post-title" />
</p>
<p class="input-wrapper"><textarea name="post_content" id="post-content" cols="150" rows="150">
</textarea>
</p>
<input name="write_post" type="submit" value="Save" id="save-post" />
</fieldset>
</form>
therefore get rid of the premble if I use a trunk function like this
(I mean a sort of read more)
function stringTransform($str,$len) {
if(strlen($str)>$len){
preg_match("/^(?=(.{{$len},}?\b))/s",$str,$chunked);
$str= $chunked[1].'...';
}
return $str;
}
$content = "<p>Opera powers the Web on any device.Surfe the full Web and create dynamic applications using Web technology with <a href=\"http://www.opera.com/\">Opera 9</a> for Devices</p>";
echo stringTransform($content,130);
How can I do not to get rid of 'a' tag or whatever tag put at the end of
the limit in this case 130 ? :o
Bye.