Compdigitec Labs

« | Home | »

Changing the user agent of PHP

By admin | August 20, 2008

If you ever need to adjust or change the default user agent that PHP accesses pages with (http and ftp wrappers) because either the default PHP user agent was blocked (“PHP”) or you wrote a bot with PHP and wish to customize it, you can do so easily with a php directive called “user_agent”. Note that 3rd party ways (such as cURL) are not affected by this setting.

To set it, you can use the following function:

<?php

function set_php_user_agent($useragent = ‘PHP’) {
$u = strval($useragent);
if(
ini_set(‘user_agent’,$u) === false) {
$r = false;
} else {
$r = true;
}
return
$r;
}

// Example:
set_php_user_agent(‘TestAgent/1.0 (http://www.example.com/testagent/)’);

?>

To get you started, here are some user agents for you to use or test:

If you found this article interesting or helpful, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more interesting articles!

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: Internet, PHP | 596 Comments »

596 Responses to “Changing the user agent of PHP”

  1. iqos thailand Says:
    January 9th, 2026 at 16:30

    สวัสดีครับ เขียนได้ดีมากเลยครับ ช่วยให้เข้าใจเรื่อง iqos มากขึ้น เป็นกำลังใจให้นะครับ

    Feel free to visit my web-site – iqos thailand

  2. iqos iluma Says:
    January 9th, 2026 at 16:35

    ทักทายครับ เนื้อหาแน่นปึ้ก อ่านแล้วได้ความรู้เรื่อง iqos เพิ่มขึ้นเยอะเลย ขอบคุณมากครับ

    Have a look at my pafe … iqos iluma

  3. iqos bangkok Says:
    January 9th, 2026 at 16:50

    ทักทายครับ ชอบบทความนี้จัง ใครที่สนใจ
    iqos ต้องมาอ่านตรงนี้เลย ขอบคุณมากครับ

    My webpage … iqos bangkok

  4. iqos thailand Says:
    January 9th, 2026 at 17:35

    สวัสดีครับ เนื้อหาแน่นปึ้ก ช่วยให้เข้าใจเรื่อง iqos มากขึ้น ขอบคุณมากครับ

    my site – iqos thailand

  5. iqos iluma Says:
    January 9th, 2026 at 17:41

    สวัสดีครับ ชอบบทความนี้จังอ่านแล้วได้ความรู้เรื่อง iqos เพิ่มขึ้นเยอะเลย ขอบคุณมากครับ

    Also visit my blog post :: iqos iluma

  6. iqos iluma Says:
    January 9th, 2026 at 17:45

    ทักทายครับ บทความนี้มีประโยชน์มาก
    ใครที่สนใจ iqos ต้องมาอ่านตรงนี้เลย ขอบคุณมากครับ

    Here is my web site :: iqos iluma

  7. iqos Says:
    January 9th, 2026 at 17:48

    ทักทายครับ เนื้อหาแน่นปึ้ก ใครที่สนใจ iqos ต้องมาอ่านตรงนี้เลย เป็นกำลังใจให้นะครับ

  8. iqos bangkok Says:
    January 10th, 2026 at 04:09

    สวัสดีจ้า เขียนได้ดีมากเลยครับ กำลังหาข้อมูลเกี่ยวกับ iqos อยู่พอดี ขอบคุณมากครับ

    Here is my site; iqos bangkok

  9. iqos terea Says:
    January 10th, 2026 at 04:22

    สวัสดีจ้า ชอบบทความนี้จัง
    ช่วยให้เข้าใจเรื่อง iqos มากขึ้น ขอบคุณที่แบ่งปันข้อมูลดีๆ ครับ

    Take a look at my website … iqos terea

  10. terea iqos Says:
    January 10th, 2026 at 04:44

    สวัสดีจ้าเนื้อหาแน่นปึ้ก กำลังหาข้อมูลเกี่ยวกับ iqos อยู่พอดี เป็นกำลังใจให้นะครับ

    Alsso visit my weeb page; terea iqos

  11. discuss Says:
    January 10th, 2026 at 04:49

    ทักทายครับ ชอบบทความนี้จัง ใครที่สนใจ iqos ต้องมาอ่านตรงนี้เลย ขอบคุณมากครับ

    my web-site: discuss

  12. iqos Says:
    January 10th, 2026 at 05:32

    สวัสดีจ้า ชอบบทความนี้จัง ช่วยให้เข้าใจเรื่อง iqos มากขึ้น จะรอติดตามบทความต่อไปนะครับ

  13. iqos bangkok Says:
    January 11th, 2026 at 17:30

    สวัสดีครับ บทความนี้มีประโยชน์มาก
    ใครที่สนใจ iqos ต้องมาอ่านตรงนี้เลย เป็นกำลังใจให้นะครับ

    Here is my site – iqos bangkok

  14. terea iqos Says:
    January 11th, 2026 at 18:29

    สวัสดีจ้า เขียนได้ดีมากเลยครับ ใครที่สนใจ
    iqos ต้องมาอ่านตรงนี้เลย เป็นกำลังใจให้นะครับ

    Feel free to visit myy site; terea iqos

  15. iqos iluma Says:
    January 11th, 2026 at 18:35

    สวัสดีจ้า ชอบบทความนี้จัง ใครที่สนใจ iqos ต้องมาอ่านตรงนี้เลย ขอบคุณที่แบ่งปันข้อมูลดีๆ ครับ

    My webpage; iqos iluma

  16. iqos iluma Says:
    January 11th, 2026 at 18:38

    สวัสดีครับ บทความนี้มีประโยชน์มาก ใครที่สนใจ iqos ต้องมาอ่านตรงนี้เลย ขอบคุณมากครับ

    My website – iqos iluma

  17. terea iqos Says:
    January 11th, 2026 at 19:18

    ทักทายครับ เนื้อหาแน่นปึ้ก ใครที่สนใจ iqos ต้องมาอ่านตรงนี้เลย
    ขอบคุณที่แบ่งปันข้อมูลดีๆ ครับ

    my blog post … terea iqos

  18. iqos bangkok Says:
    January 11th, 2026 at 19:20

    ทักทายครับ เขียนได้ดีมากเลยครับ ช่วยให้เข้าใจเรื่อง iqos มากขึ้น ขอบคุณมากครับ

    my homepage; iqos bangkok

  19. iqos thailand Says:
    January 11th, 2026 at 19:29

    สวัสดีครับ ชอบบทความนี้จัง ช่วยให้เข้าใจเรื่อง iqos มากขึ้น ขอบคุณมากครับ

    My webb page; iqos thailand

  20. iqos bangkok Says:
    January 11th, 2026 at 19:35

    ทักทายครับเนื้อหาแน่นปึ้ก
    กำลังหาข้อมูลเกี่ยวกับ iqos อยู่พอดี จะรอติดตามบทความต่อไปนะครับ

    My homepage … iqos bangkok

  21. iqos terea Says:
    January 11th, 2026 at 19:38

    สวัสดีจ้า บทความนี้มีประโยชน์มาก ช่วยให้เข้าใจเรื่อง
    qos มากขึ้น เป็นกำลังใจให้นะครับ

    Feel free too surf to my blog post … iqos terea

  22. iqos thailand Says:
    January 11th, 2026 at 19:40

    สวัสดีจ้า ชอบบทความนี้จัง
    ใครที่สนใจ iqos ต้องมาอ่านตรงนี้เลย เป็นกำลังใจให้นะครับ

    Alsoo visit mmy web blog … iqos thailand

  23. terea iqos Says:
    January 11th, 2026 at 19:45

    สวัสดีจ้า เขียนได้ดีมากเลยครับ กำลังหาข้อมูลเกี่ยวกับ iqos
    อยู่พอดี จะรอติดตามบทความต่อไปนะครับ

    Here is my page: terea iqos

  24. iqos Says:
    January 11th, 2026 at 19:45

    ทักทายครับ บทความนี้มีประโยชน์มาก กำลังหาข้อมูลเกี่ยวกับ iqos
    อยู่พอดี จะรอติดตามบทความต่อไปนะครับ

  25. iqos bangkok Says:
    January 11th, 2026 at 19:46

    ทักทายครับ บทความนี้มีประโยชน์มาก ใครที่สนใจ iqos ต้องมาอ่านตรงนี้เลย จะรอติดตามบทความต่อไปนะครับ

    My wweb site: iqos bangkok

  26. iqos Says:
    January 11th, 2026 at 20:12

    สวัสดีจ้า ชอบบทความนี้จัง อ่านแล้วได้ความรู้เรื่อง iqos เพิ่มขึ้นเยอะเลย
    ขอบคุณมากครับ

  27. iqos Says:
    January 11th, 2026 at 20:22

    ทักทายครับ ชอบบทความนี้จัง กำลังหาข้อมูลเกี่ยวกับ iqos อยู่พอดี ขอบคุณที่แบ่งปันข้อมูลดีๆ
    ครับ

  28. iqos bangkok Says:
    January 12th, 2026 at 03:30

    สวัสดีครับ เขียนได้ดีมากเลยครับ อ่านแล้วได้ความรู้เรื่อง iqos เพิ่มขึ้นเยอะเลย ขอบคุณมากครับ

    Feel free to surf to my website iqos bangkok

  29. iqos bangkok Says:
    January 12th, 2026 at 03:34

    สวัสดีจ้า บทความนี้มีประโยชน์มาก ใครที่สนใจ iqs ต้องมาอ่านตรงนี้เลย เป็นกำลังใจให้นะครับ

    Feel free to surf to my blog; iqos bangkok

  30. iqos thailand Says:
    January 12th, 2026 at 03:37

    สวัสดีจ้า ชอบบทความนี้จัง
    อ่านแล้วได้ความรู้เรื่อง iqos เพิ่มขึ้นเยอะเลย ขอบคุณมากครับ

    Check out my blog: iqos thailand

  31. iqos Says:
    January 12th, 2026 at 03:56

    ทักทายครับ ชอบบทความนี้จัง อ่านแล้วได้ความรู้เรื่อง
    iqos เพิ่มขึ้นเยอะเลย จะรอติดตามบทความต่อไปนะครับ

  32. iqos terea Says:
    January 12th, 2026 at 04:16

    ทักทายครับ เนื้อหาแน่นปึ้ก กำลังหาข้อมูลเกี่ยวกับ iqos อยู่พอดี เป็นกำลังใจให้นะครับ

    Also visit my homepage … iqos terea

  33. iqos bangkok Says:
    January 12th, 2026 at 04:41

    ทักทายครับ เขียนได้ดีมากเลยครับ อ่านแล้วได้ความรู้เรื่อง iqos
    เพิ่มขึ้นเยอะเลย เป็นกำลังใจให้นะครับ

    my site :: iqos bangkok

  34. iqos bangkok Says:
    January 12th, 2026 at 04:46

    ทักทายครับเขียนได้ดีมากเลยครับ ช่วยให้เข้าใจเรื่อง iqos มากขึ้น
    ขอบคุณที่แบ่งปันข้อมูลดีๆ ครับ

    Feel free to surf to my blog; iqos bangkok

  35. iqos bangkok Says:
    January 12th, 2026 at 04:54

    สวัสดีครับ เขียนได้ดีมากเลยครับ อ่านแล้วได้ความรู้เรื่อง
    iqos เพิ่มขึ้นเยอะเลย เป็นกำลังใจให้นะครับ

    my web blog; iqos bangkok

  36. iqos thailand Says:
    January 12th, 2026 at 06:04

    สวัสดีจ้า บทความนี้มีประโยชน์มาก ช่วยให้เข้าใจเรื่อง iqos มากขึ้น จะรอติดตามบทความต่อไปนะครับ

    Feel free to surf tto my web blog … iqos thailand

  37. iqos bangkok Says:
    January 12th, 2026 at 06:17

    ทักทายครับ บทความนี้มีประโยชน์มาก ช่วยให้เข้าใจเรื่อง iqos มากขึ้น จะรอติดตามบทความต่อไปนะครับ

    Here is mmy website :: iqos bangkok

  38. iqos iluma Says:
    January 12th, 2026 at 06:59

    ทักทายครับ เขียนได้ดีมากเลยครับ ช่วยให้เข้าใจเรื่อง iqos มากขึ้น จะรอติดตามบทความต่อไปนะครับ

    Take a look at my homepage … iqos iluma

  39. iqos Says:
    January 12th, 2026 at 07:08

    ทักทายครับ เนื้อหาแน่นปึ้ก ช่วยให้เข้าใจเรื่อง iqos มากขึ้น ขอบคุณมากครับ

  40. iqos bangkok Says:
    January 12th, 2026 at 07:24

    สวัสดีจ้า เขียนได้ดีมากเลยครับ ช่วยให้เข้าใจเรื่อง iqos มากขึ้น ขอบคุณมากครับ

    Review my web-site … iqos bangkok

  41. terea iqos Says:
    January 12th, 2026 at 07:50

    สวัสดีครับ เขียนได้ดีมากเลยครับ กำลังหาข้อมูลเกี่ยวกับ iqos อยู่พอดี จะรอติดตามบทความต่อไปนะครับ

    my web bloog :: terea iqos

  42. iqos thailand Says:
    January 12th, 2026 at 08:36

    สวัสดีครับ บทความนี้มีประโยชน์มาก กำลังหาข้อมูลเกี่ยวกับ iqos อยู่พอดี ขอบคุณมากครับ

    Look at my web page iqos thailand

  43. iqos terea Says:
    January 12th, 2026 at 09:00

    สวัสดีจ้า บทความนี้มีประโยชน์มาก
    กำลังหาข้อมูลเกี่ยวกับ iqos อยู่พอดี ขอบคุณมากครับ

    Feel free to visit my page: iqos terea

  44. terea iqos ราคาส่ง Says:
    January 13th, 2026 at 03:02

    ชอบบทความนี้มากครับ

    Look into my websote … terea iqos ราคาส่ง

  45. terea iqos ราคาส่ง Says:
    January 13th, 2026 at 03:28

    เป็นข้อมูลที่ดีมากครับ

    My ssite terea iqos ราคาส่ง

  46. บุหรี่ terea Says:
    January 13th, 2026 at 08:05

    สุดยอดเลยครับสำหรับบทความนี้

    Stop by my website … บุหรี่ terea

Comments