PHP client library

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.

ResourceDescription
Library referenceCloud Translation PHP library reference
Language guideGeneral guide for using PHP with GCP
GitHub repositorySource code and additional documentation for this library
QuickstartIntroduction to using this library
Stack OverflowQuestions 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.