PHP5 example tutorial to simply generate barcode_PHP tutorial
The PHP5 version is used in this article. Be sure to turn on PHP's GD module before use. This is php_gd2.dll in Windows and gd.so in Linux. Extract the compressed file to Apache and execute http://localhost/barcode/index.php. PHP5 generates barcodes as shown below:
1. Type: Select the barcode type
2. Output: output image format
3. Thickness: Barcode height
4. Resolution: barcode size
5. Font: the size of the text below the barcode, or no text displayed

6. Text: The content of barcode printing
Of course, this PHP5 barcode generation program only generates text into barcodes, but it cannot be flexibly embedded into other PHP programs when used. I made some adjustments to test.php in the compressed package so that it can be flexibly used. Other programs. When running, just pass the barcode type and text to test.php, for example:
http://localhost/barcode/test.php?codebar=BCGcode39&text=20090729
Or run http://localhost/barcode/mytest.php
mytest.php code:
PHP5 generates barcode renderings:

PHP5 generates barcode test.php code:
// Including all required classes require(class/BCGFont.php);
require(class/BCGColor.php); require(class/BCGDrawing.php);
/*BCGcodabar,BCGcode11,BCGcode39,BCGcode39extended,BCGcode93, BCGcode128,BCGean8,BCGean13,BCGisbn,BCGi25,BCGs25,BCGmsi,
BCGupca,BCGupce,BCGupcext2,BCGupcext5,BCGpostnet,BCGothercode*/ $codebar = $_REQUEST[codebar]; //For all codes supported by this software, just adjust the $codebar parameter.
// Including the barcode technology include(class/.$codebar..barcode.php);
// Loading Font $font = new BCGFont(./class/font/Arial.ttf, 10);
// The arguments are R, G, B for color. $color_black = new BCGColor(0, 0, 0);
$color_white = new BCGColor(255, 255, 255); $code = new $codebar();
$code->setScale(2); // Resolution $code->setThickness(30); // Thickness
$code->setForegroundColor($color_black); // Color of bars $code->setBackgroundColor($color_white); // Color of spaces
$code->setFont($font); //Font (or 0) $text = $_REQUEST[text]; //PHP5 generates the content of the barcode data
$code->parse($text); /* Here is the list of the arguments
1 - Filename (empty: display on screen) 2 - Background color */
$drawing = new BCGDrawing(, $color_white); $drawing->setBarcode($code);
$drawing->draw(); // Header that says it is an image (remove it if you save the barcode to a file)
header(Content-Type: image/png); // Draw (or save) the image into PNG format.
$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Dewu APP is currently a very popular brand shopping software, but most users do not know how to use the functions in Dewu APP. The most detailed usage tutorial guide is compiled below. Next is the Dewuduo that the editor brings to users. A summary of function usage tutorials. Interested users can come and take a look! Tutorial on how to use Dewu [2024-03-20] How to use Dewu installment purchase [2024-03-20] How to obtain Dewu coupons [2024-03-20] How to find Dewu manual customer service [2024-03-20] How to check the pickup code of Dewu [2024-03-20] Where to find Dewu purchase [2024-03-20] How to open Dewu VIP [2024-03-20] How to apply for return or exchange of Dewu

Cloud storage has become an indispensable part of our daily life and work nowadays. As one of the leading cloud storage services in China, Baidu Netdisk has won the favor of a large number of users with its powerful storage functions, efficient transmission speed and convenient operation experience. And whether you want to back up important files, share information, watch videos online, or listen to music, Baidu Cloud Disk can meet your needs. However, many users may not understand the specific use method of Baidu Netdisk app, so this tutorial will introduce in detail how to use Baidu Netdisk app. Users who are still confused can follow this article to learn more. ! How to use Baidu Cloud Network Disk: 1. Installation First, when downloading and installing Baidu Cloud software, please select the custom installation option.

NetEase Mailbox, as an email address widely used by Chinese netizens, has always won the trust of users with its stable and efficient services. NetEase Mailbox Master is an email software specially created for mobile phone users. It greatly simplifies the process of sending and receiving emails and makes our email processing more convenient. So how to use NetEase Mailbox Master, and what specific functions it has. Below, the editor of this site will give you a detailed introduction, hoping to help you! First, you can search and download the NetEase Mailbox Master app in the mobile app store. Search for "NetEase Mailbox Master" in App Store or Baidu Mobile Assistant, and then follow the prompts to install it. After the download and installation is completed, we open the NetEase email account and log in. The login interface is as shown below

The meaning and difference of PHP version NTS PHP is a popular server-side scripting language that is widely used in the field of web development. There are two main versions of PHP: ThreadSafe(TS) and Non-ThreadSafe(NTS). On the official website of PHP, we can see two different PHP download versions, namely PHPNTS and PHPTS. So, what does PHP version NTS mean? What is the difference between it and the TS version? Next,

1. First open WeChat. 2. Click [+] in the upper right corner. 3. Click the QR code to collect payment. 4. Click the three small dots in the upper right corner. 5. Click to close the voice reminder for payment arrival.

MetaMask (also called Little Fox Wallet in Chinese) is a free and well-received encryption wallet software. Currently, BTCC supports binding to the MetaMask wallet. After binding, you can use the MetaMask wallet to quickly log in, store value, buy coins, etc., and you can also get 20 USDT trial bonus for the first time binding. In the BTCCMetaMask wallet tutorial, we will introduce in detail how to register and use MetaMask, and how to bind and use the Little Fox wallet in BTCC. What is MetaMask wallet? With over 30 million users, MetaMask Little Fox Wallet is one of the most popular cryptocurrency wallets today. It is free to use and can be installed on the network as an extension

Regarding Llama3, new test results have been released - the large model evaluation community LMSYS released a large model ranking list. Llama3 ranked fifth, and tied for first place with GPT-4 in the English category. The picture is different from other benchmarks. This list is based on one-on-one battles between models, and the evaluators from all over the network make their own propositions and scores. In the end, Llama3 ranked fifth on the list, followed by three different versions of GPT-4 and Claude3 Super Cup Opus. In the English single list, Llama3 overtook Claude and tied with GPT-4. Regarding this result, Meta’s chief scientist LeCun was very happy and forwarded the tweet and

After rain in summer, you can often see a beautiful and magical special weather scene - rainbow. This is also a rare scene that can be encountered in photography, and it is very photogenic. There are several conditions for a rainbow to appear: first, there are enough water droplets in the air, and second, the sun shines at a low angle. Therefore, it is easiest to see a rainbow in the afternoon after the rain has cleared up. However, the formation of a rainbow is greatly affected by weather, light and other conditions, so it generally only lasts for a short period of time, and the best viewing and shooting time is even shorter. So when you encounter a rainbow, how can you properly record it and photograph it with quality? 1. Look for rainbows. In addition to the conditions mentioned above, rainbows usually appear in the direction of sunlight, that is, if the sun shines from west to east, rainbows are more likely to appear in the east.
