Hello Aekansh,
I'm afraid, we do not have the PHP code sample to create Custom Affinity audience. Please find the code snippet in Java as a reference.
CustomAffinityServiceInterface listService = adWordsServices.get(session, CustomAffinityServiceInterface.class);
CustomAffinity audience = new CustomAffinity();
audience.setStatus(CustomAffinityStatus.ENABLED);
audience.setName("Custom Created Intent_47");
audience.setType(CustomAffinityType.CUSTOM_INTENT);
CustomAffinityOperation operation = new CustomAffinityOperation();
operation.setOperand(audience);
operation.setOperator(Operator.ADD);
CustomAffinityOperation[] operations = new CustomAffinityOperation[] {operation};
CustomAffinityReturnValue result = listService.mutate(operations);
You may refer this and try it out in PHP. Let me know if you have any issues, I'll be happy to take a look.
Thanks,
Bharani, Google Ads API Team

ref:_00D1U1174p._5001UODtta:ref