Puzzle: article content in a MySQL field, read the content in PHP, how to put the number inside the picture content output

Source: Internet
Author: User
Puzzle: article content in MySQL a field, read the content in PHP, how to put the number inside, to the picture content output!
Php+mysql questions:
The article content in a MySQL field, in order to prevent copying collection, intends to the content of the "Arab" numbers, output as a picture format, my idea is: with PHP first read the content of the article, and then judge the number inside, whatever the number, it is displayed as a picture! Effect


Problem: The number of an article in more than one place, some reach hundreds of places, and some numbers are with a decimal point, such as 12.3, so many numbers, how to output?

Tip: The article is to introduce the market, all the numbers behind have a Chinese character "Yuan", such as 15.6 yuan, 14-17 yuan, 48 yuan and so on.

can you pass some of the characters in front of "yuan" into the picture output?

my points are not much, altogether only 25 points, all gave!
------Solution--------------------
$con = <<
 <>
Guangxi Price 14-17.5 USD
Guangdong Retail price 23.5 yuan
Sichuan Retail Price 13 RMB
Inner Mongolia retail price 0.14 yuan
Context
$rep = Preg_replace ('/([\d\.-]+) yuan/I ', ' $ ', $con);
Var_dump ($REP);

------Solution--------------------
You save a series of digital pictures in the image directory 0.gif, 1.gif ....
And then
$text = preg_replace ('/\d/', ' ', $text);

------Solution--------------------
More illegal characters.
Reported 500 wrong because you didn't turn on the error display function
$con = <<
 <>
Evodiamine: supply reduction, the price is still high, there is a lot of goods sold in the market, the price of the flower variety is 43-52 yuan, floret, large flower varieties of 37-42 yuan.
Gardenia: Move faster, the current red price is 28-32 yuan.
Schizonepeta Tenuifolia: The wild goods to reduce, spacerl goods insufficient, recently moved around the smooth, CD price now is 6-7.5 Yuan.
Elsholtzia Grass: In recent years, few species, the city of rare commodities, this period has sporadic movement, CD price of 7-11 Yuan.
: With more, moving faster, the bulk of the price of 7-8 yuan. Houttuynia cordata stock is sufficient, sporadic walk fast, the price is stable, CD is now 6-8 Yuan.
Honeysuckle: The city is full of goods, commodities are scattered around, the price is stable, the current real estate CD price of 45-60 Yuan.
Safflower: A small deal, the price is now 95-97 yuan. Chrysanthemum walk Less, cake price is 90-110 yuan. Lily does not move much, the price is stable at 42-45 yuan.
Xinyi Flower: Moving around generally, the price stabilized, the big flower is 30-32 yuan, Floret is 35-37 yuan.
Dragon: There are small quantities of supply market, merchandise sold to sporadic mainly, wide open for 160-175 yuan, the open for 95-115 yuan.
Hives: Less moving, soft goods market price stability of 250-300 yuan.
Leech: Supply is not much, walking also unpleasant, the price stabilized, is now 800-900 yuan of clean water products.
Centipede: New products will be listed, moving slowly, now large bar 2.5-2.7 yuan, the article 2.2-2.4 yuan, strips 0.9-1.1 yuan.
Sheds: The market is relatively small, the price is stable at 100-115 yuan.
Codonopsis: volume reduction, price stability, the current party price of 70-85 yuan, white bars for 45-60 yuan.
Scrophulariaceae: Planting area is reduced, recently the market is insufficient, the trend is smooth, now CD price is 12-14 yuan.
Pseudostellaria Heterophylla: Supply more sufficient, small batch walk, the price stable at 45-60 yuan.
Context
$con = preg_replace ('/\d/', ' ', $con);
Var_dump ($con);
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.