Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common tips of PHP?

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "what tips are commonly used in PHP", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the commonly used tips in PHP" this article?

1. Naming

2. Use

When the plan is part of the sql instruction: if the field participating in the control is numeric, then

If (! Emptyempty ($_ POST ['checkbox']) {$expr = join (",", $_ POST [' checkbox']); $sql = "select * from tbl_name where field in ($expr)";}

If the field that participates in the control is numeric,

If (! Emptyempty ($_ POST ['checkbox']) {$expr = "'" .join ("','", $_ POST ['checkbox']). "."; $sql = "select * from tbl_name where field in ($expr)";}

PHP determines whether the Form form is submitted or not

$action=$HTTP_POST_VARS ["Button1"]; if ($action== "submit") {/ / execute form action} else {/ / read default}

PHP gets the string length

Strlen ($myrow [1])

PHP Url steering

Header ("Location:". $_ SERVER ["HTTP_REFERER"])

PHP superglobal object

PHP form value

If mothod= "get", replace $test with $_ GET ["test"]

If mothod= "post", replace $test with $_ POST ["test"]

PHP gets the current IP

PHP got the current time date ("Y year m month d day") Date ("Y-n-j") above are all the contents of this article entitled "what are the common tips for PHP". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report