 |
สอบถาม การลบ String ข้อความ ใน array ของ PHP (หากมีแบบฟอร์ม PHP ให้เลยยิ่งดีใหญ่) |
|
 |
|
|
 |
 |
|
พอดีผมมี String ข้อความหนึ่งๆ ครับแบบนี้
Code (PHP)
'threadtype_infotypes_noexist' => 'Thread Category Option does not exist',//'主题选项分类不存在',
'typeoption_not_found' => 'Option not found',//'选项未找到',
'threadtype_infotypes_option_succeed' => 'Category extended options updated successfully',//'分类扩展选项成功更新',
'threadtype_infotypes_invalid' => 'Category should have at least one option, please return to modify.',//'分类信息至少应该有一个选项,请返回修改。',
'threadtype_content_no_choice' => 'Categories have no choice',//'没有选择分类信息',
'threadtype_content_delete_succeed' => 'Data deletion completed',//'数据删除完成',
ผมอยากจะลบข้อความที่มีตั้งแต่คำว่า "//" เป็นต้นไป
เช่นคำนี้ Code (PHP)
'threadtype_content_delete_succeed' => 'Data deletion completed',//'数据删除完成',
ให้เหลือแค่ Code (PHP)
'threadtype_content_delete_succeed' => 'Data deletion completed',
ท่านใดพอจะแนะนำฟังก์ชัน หรือซอร์สโค๊ด PHP สำหรับการดำเนินการนี้หรือไม่ครับ(มีแบบฟอร์มพร้อมดำเนินการ จักขอบพระคุณยิ่งครับ)
รบกวนช่วยด้วยนะครับ
ปล. มันเป็นไฟล์ภาษาของดิสคัสน่ะครับ สาวกดิสคัส อาจจะเคยเห็นแว๊บๆ สำหรับตัวแปรภาษาตัวนี้ ^^
Tag : PHP, CakePHP
|
|
 |
 |
 |
 |
Date :
2012-05-07 12:55:56 |
By :
jaideejung007 |
View :
3623 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้ strstr ครับ ง่าย ๆ
Code (PHP)
<?php
$email = '[email protected]';
$domain = strstr($email, '@');
echo $domain; // prints @example.com
$user = strstr($email, '@', true); // As of PHP 5.3.0
echo $user; // prints name
?>
|
 |
 |
 |
 |
Date :
2012-05-07 19:02:47 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|