ผมไปหาโค๊ด php ตัดคำในเน็ตมาได้แบบนี้แต่ไม่รู้จะเอาไปใช้ยังครับ
คือให้มันตัดคำเหลือแต่คำว่า USER
<?php
$email = '[email protected]';
$new_email=stristr($email, '@', true);
<? echo $new_email; ?>
?>
ผมอยากได้ประมาณว่าใส่ค่าที่ต้องการตัดคำเข้าไปในฟอร์มแล้วกดซับมิทค่าออกมา เช่นใส่คำว่า
[email protected] กดซับมิทออกมาเป็น USER
ผมลองเขียนประมาณนี้ดูแต่กดซับมิทแล้วไม่มีไรเกิดขึ้นเลย
ไม่ทราบว่าผมใส่ค่าไรผิดไปหรือป่าวครับ คือผมไม่รู้เรื่อง php แม้แต่นิดเดียวเลยครับ
<form method="post">
<div align="center"><textarea name="post" ></textarea></div>
<div align="center"><input type="submit" value="Submit"></div>
</form>
<?php
$email = $post;
$new_email=stristr($email, '@', true);
?>
<textarea readonly="true" cols="100" rows="3" name="post" >
<? echo $new_email; ?>
</textarea>
</div>