PHP text drawing program error, please solve, how to deal with it
An error occurred in the PHP text drawing program. The solutionThe program code is as follows:<?php $im=imagecreatetruecolor(400,30); $white=imagecolorallocate($im,255,255,255); $grey=imagecolorallocate($im,128,128,128); $black=imagecolorallocate($im,0,0,0); imagefilledrectangle($im,0,0,399,29,$ white); $text=iconv(“GB2312″,”UTF-8″,”PHP text drawing program”); //If there is Chinese output, it needs to be transcoded and converted into UTF-8 characters Strings can be passed directly $fOnt=’simsun.ttc’; imagettftext($im,20,0,12,21,$grey,$font,$text); //Output a gray string as a shadow imagettftext($im,20,0,10,20,$black,$font,$text); //Output a black string above the shadow header( ‘Content-type:image/png’); imagepng($im); imagedestroy($im);?>The browser displays as follows: Please tell me, what is the problem? ——Solution——————– Didn’t he clearly tell you that the font file cannot be found? $fOnt=’simsun.ttc’;//Writing like this requires copying simsun.ttc to the current directoryWriting during testing$fOnt= ‘c:/ windws/fonts/simsun.ttc’;That’s it ——Solution——————–fonts The folder is different from other folders. What you see are the names of the fonts and not the file names. You have to check the properties to seesimsun.ttc is Song Dynasty & New Song Dynasty
The copycat version of PHP168 whole site system has made its debut, how to deal with it
PHP168 whole-site system copycat version makes its debutCompared with the previously officially released v6 official version, the general differences are as follows: 1. Added that when the website is closed, the administrator can still enter the background to update Label. 2. Add column navigation to the front desk, add subscription links, and display the number of contents under the column. 3. The front member center adds a member list view and supports search. 4. Add a text search switch after commenting, and you can set it to require members to comment first and then view the content 5. Add a backend to modify the comment content. 6. Add online people statistics and switch display. 7. E-commerce settings add settings to display the payment method switch. 8. Add a switch to search by entering keywords. You can click the column to search without entering keywords. 9. The tag (keyword) management interface adds a quick enable and close display, and supports display on the search page. 10. Add voice prompts for new messages on the site. 11. Add tag variable management, click the tag to edit and modify it directly. 12. Add file attribute check. 13. Add founder modifications. 14. Add tag…
PHP framework, how to deal with it
PHP FrameworkNewbie. . What framework is generally used for PHP development now? Small website, medium website, large website. It is better to develop using those frameworks respectively. ——Solution——————–If you are a novice, it is recommended to learn ci ——Solution——————–Suggestions No framework is needed! ——Solution——————– Discuss It is recommended that no framework be used! ——Solution——————– Discussion Quote: It is recommended not to use any framework! Don’t use those encapsulated database operation classes either. ——Solution——————–2 ,The words on the 3rd and 4th floors are pure nonsense and can be ignored. This is a common problem among “masters”: they are self-righteous, arrogant, and have their eyes above their heads. ——Solution——————–A Mature open source products generally do not use frameworks. If you don’t know basic PHP development, I suggest you don’t use it firstIf you know it and plan to use a framework, you can choose one to learn. For example, thinkphp, zend framework, yii, cake, ci and so on. This is mainly a personal preference ——Solution——————–A Mature open source products generally do not use frameworks. If you don’t know basic PHP development, I suggest you don’t use it firstIf you know it and plan to use a framework, you can choose one to…
PHP blog writing program, how to deal with it
PHP blog writing programWhat I want most is a program about blogging, that is, the program on this page. I have read the blogs of some websites, and they all seem to be somewhat different. I don’t know what content to write in them. What should be written on the main page, urgent need, ——Solution—————— —Basic functions:User registration, login, password changePublish, modify, view, delete blog postsPost comments, comment replies ——Solution——————–Blog It is a place to show your individuality. There is no and should not be a unified standardYou can do it according to the style you like. If you encounter any questions, come back and ask. ——Solution——————–Suggestion Be small and good, otherwise you will not be competitive with big blogs, and no one will come to playIt is enough to add, delete, modify and check in the early stageSlowly expand after setting up the structureBlog blog, Article processing is the most basic, otherwise forget about doing anything elseOn the homepage, just display personal information, such as avatar nameThe main part displays the micro-article content, and you can add some visitors on the right, etc.You can go to Everyone in Sina or QQ space can find inspiration ——Solution——————–Main It’s a pain…
PHP two-dimensional array sorting, how to deal with it
PHP two-dimensional array sorting$ary=array(array(“ID”=>13,”name”=>”kitty”),array(“ID”=>22,”name”=>”sony”) ,array(“ID”=>17,”name”=>”picker”));I want to adjust the order of the one-dimensional array in ascending order of ID, and the result isarray(array(” ID”=>13,”name”=>”kitty”),array(“ID”=>17,”name”=>”picker”),array(“ID”=>22,”name”=>” sony”));How should I write it? ——Solution——————– Someone asked just two days ago… PHP code $ary=array(array(“ID”=>13,”name”=>”kitty”),array(“ID”=>22,”name”=>”sony”),array(“ID”=> 17,”name”=>”picker”)); foreach ($ary as $key => $value) { $Id[$key] =$value[‘ID’]; $Name[$key] = $value[‘name’]; } array_multisort($Id, SORT_ASC,$ary); print_r($ary);
phpwind framework explained, how to deal with it
Explanation of phpwind frameworkDoes anyone know about the phpwind framework? It’s okay to have a link. I’m new to phpwind secondary development, urgently need it. . . ——Solution——————–Are you talking about this framework?http://down.51cto.com/data/395312 There are many related documents for the secondary development of phpwind. ——Solution——————–phpwind Official Forums ——Solution——————–Go php100 ——Solution——————– Discussion I also asked Daniel a question, how can I share the account of other systems to log in to my forum without having to register again? What should I do?
PHP simulates the Linux command line, how to deal with it
php simulates linux command lineI just interviewed with a company. They plan to let me make something that uses php to simulate the linux command line. However, I have never been exposed to linux and I don’t have any ideas for the time being. If you have any trouble, it’s okay, please help. Give me some ideas… Maybe they plan to bring this to FreeBSD, and they are even less familiar with Unix ——Solution—- —————-Simulate command line? Is there any details? What does the simulated command line look like? Call shell? ——Solution——————–Directly :exec(“ps -awx”);system(“ps -awx”);can be executed as well ——Solution——————– Discussion It is equivalent to the same effect as a Linux terminal. You can type commands and execute them, but it does not open a window but a php page ——Solution——————–Simple Demo: PHP code ——Solution——————–Research ssh protocol ——Solution——————–Main It is permission management. PHP only has the user owner of the web server. What permissions do you plan to give it?
phpsqlite, how to deal with it
php sqlitephp sqlite database query is written like this: $db = new SQLite3(‘my.db’);$update=”select * from good”;$result = $db->query($update); Is there any function that can get the number of rows in this result set? ——Solution——————– php_sqlite3 provides 3 classesprovided respectivelyprint_r(get_class_methods(‘sqlite3’));print_r(get_class_methods(‘SQLite3Result’));print_r(get_class_methods(‘ SQLite3Stmt’));These methods There seems to be no method to get the number of rows in the result setBut the SQLite3Result class may provide an attribute for the number of rows in the result set. You can take a look. If you don’t have any, just count(*)
PHP Chinese verification code, how to deal with it
php Chinese verification code PHP code <?php Header("Content-type: image/PNG"); $ch_str="The first thing is that in the discord, there is a large number of people in the country who need to use domestic products to divide students into students at different ages. Fang Jin's colleagues said in an interview that after the revolution, many children were added to the social network, and the power line of the high-quality long-term party was achieved. The road map of anti-sexuality and anti-body cooperation transforms the content of the new discussion from the current situation of the two talents, such as the corresponding form, thinking, thinking, and practice, to the key points of change, the emphasis on thinking and the internal removal of causes. The daily profit phase is determined by the pressure of the qi karma and the whole group. The fruit period leads to the level of each base or the monthly hair. However, the comparison shows that it is the most external and does not look at the five interpretations of the forest. The head of the rice group only understands the four-way horse recognition. However, the article is relatively grammatical and public, leading to the inflow of the receiving seat, and…