PHP client library Stay organized with collections Save and categorize content based on your preferences.
Note: Google provides the Cloud Translation API client library for PHP as asingle package for both Cloud Translation - Advanced andCloud Translation - Basic. This page describes how to install the clientlibrary for Cloud Translation - Advanced. To use the client library forCloud Translation - Basic, see theinstallation instructions.
This page provides reference documentation and related resources for the Cloud Translation PHP client library.
| Resource | Description |
|---|---|
| Library reference | Cloud Translation PHP library reference |
| Language guide | General guide for using PHP with GCP |
| GitHub repository | Source code and additional documentation for this library |
| Quickstart | Introduction to using this library |
| Stack Overflow | Questions tagged with Cloud Translation and PHP |
Installation
To install the client library:
composer require google/cloud-translate
Using the client library
To use the PHP client library for Cloud Translation - Advanced, you mustinstantiate the Cloud Translation API client as follows:
use Google\Cloud\Translate\V3\TranslateClient;See how totranslate textfor additional usage details.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.